Skip to content

Commit

Permalink
Merge branch 'jackmu95-fix-ql-blank-class-setting' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Oct 13, 2016
2 parents ceea0bf + 6b598be commit d107d81
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,19 @@ class Quill {
this.theme.init();
let contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">${html}<p><br></p></div>`);
this.setContents(contents);
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 (this.options.readOnly) {
this.disable();
}
if (this.options.placeholder) {
this.root.setAttribute('data-placeholder', this.options.placeholder);
}
this.root.classList.toggle('ql-blank', this.editor.isBlank());
this.emitter.on(Emitter.events.TEXT_CHANGE, (delta) => {
this.root.classList.toggle('ql-blank', this.editor.isBlank());
});
}

addContainer(container, refNode = null) {
Expand Down

0 comments on commit d107d81

Please sign in to comment.