Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
editor.on('editor-change', function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this));
},
this.handleEditorChange = function (eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this);
this.editor.on(Quill.events.EDITOR_CHANGE, (eventType, range) => {
let sidebarControls = this.$refs.sidebarControls;
if (eventType !== Quill.events.SELECTION_CHANGE) {
return;
}
if (range == null) {
return;
}
if (range.length === 0) {
let [block] = this.editor.scroll.descendant(Block, range.index);
if (block != null && block.domNode.firstChild instanceof HTMLBRElement) {
let lineBounds = this.editor.getBounds(range);
sidebarControls.classList.remove('active');
sidebarControls.style.display = 'block';
sidebarControls.style.left = lineBounds.left - 50 + 'px';
sidebarControls.style.top = lineBounds.top - 2 + 'px';
this.handleEditorChange = function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this);
this.handleEditorChange = function (eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this);
this.handleEditorChange = function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this);
initSideControls() {
let Block = Quill.import('blots/block');
this.editor.on(Quill.events.EDITOR_CHANGE, (eventType, range) => {
let sidebarControls = this.$refs.sidebarControls;
if (eventType !== Quill.events.SELECTION_CHANGE) {
return;
}
if (range == null) {
return;
}
if (range.length === 0) {
let [block] = this.editor.scroll.descendant(Block, range.index);
if (block != null && block.domNode.firstChild instanceof HTMLBRElement) {
let lineBounds = this.editor.getBounds(range);
sidebarControls.classList.remove('active');
editor.on('editor-change', function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) {
if (eventType === Quill.events.SELECTION_CHANGE) {
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
if (eventType === Quill.events.TEXT_CHANGE) {
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source);
}
}.bind(this));
},