Skip to content

Commit

Permalink
Make sure data-placeholder is set before registering emitter listener
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmllr95 committed Oct 12, 2016
1 parent cec838e commit 190d0b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,24 @@ class Quill {
});
this.editor = new Editor(this.scroll, this.emitter);
this.selection = new Selection(this.scroll, this.emitter);
this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {
if (type === Emitter.events.TEXT_CHANGE) {
this.root.classList.toggle('ql-blank', this.editor.isBlank());
}
});
this.theme = new options.theme(this, options);
this.keyboard = this.theme.addModule('keyboard');
this.clipboard = this.theme.addModule('clipboard');
this.history = this.theme.addModule('history');
this.theme.init();
if (options.placeholder) {
this.root.dataset.placeholder = options.placeholder;
}
this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {
if (type === Emitter.events.TEXT_CHANGE) {
this.root.classList.toggle('ql-blank', this.editor.isBlank());
}
});
this.pasteHTML(`<div class='ql-editor' style="white-space: normal;">${html}<p><br></p></div>`);
this.history.clear();
if (options.readOnly) {
this.disable();
}
if (options.placeholder) {
this.root.dataset.placeholder = options.placeholder;
}
}

addContainer(container, refNode = null) {
Expand Down

0 comments on commit 190d0b1

Please sign in to comment.