Skip to content

Commit

Permalink
Make sure this.editor is initialized before registering emitter lis…
Browse files Browse the repository at this point in the history
…tener
  • Loading branch information
jacobmllr95 committed Oct 12, 2016
1 parent af1e7ce commit cec838e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ class Quill {
this.container.innerHTML = '';
this.root = this.addContainer('ql-editor');
this.emitter = new 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.scroll = Parchment.create(this.root, {
emitter: this.emitter,
whitelist: options.formats
});
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');
Expand Down

0 comments on commit cec838e

Please sign in to comment.