Quill DDAU
This commit is contained in:
parent
cb43c27c6f
commit
dbcc573f69
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,8 @@ import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
quill: null,
|
quill: null,
|
||||||
value: null, // passed in
|
value: null,
|
||||||
|
update: null,
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
let quill = new Quill(`#${this.get('elementId')} .editor`, {
|
let quill = new Quill(`#${this.get('elementId')} .editor`, {
|
||||||
|
@ -22,11 +23,10 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
quill.on('text-change', (delta, source) => {
|
quill.on('text-change', (delta, source) => {
|
||||||
if (source === 'user') {
|
if (source === 'user') {
|
||||||
this.set('value', Ember.$(quill.getHTML()).html());
|
this.attrs['update'](Ember.$(quill.getHTML()).html());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('quill', quill);
|
this.set('quill', quill);
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue