diff --git a/src/rich_text_editor/index.js b/src/rich_text_editor/index.js index d124bc47c..748fb5b11 100644 --- a/src/rich_text_editor/index.js +++ b/src/rich_text_editor/index.js @@ -138,7 +138,7 @@ module.exports = () => { * @example * rte.add('bold', { * icon: 'B', - * attributes: {title: 'Bold',} + * attributes: {title: 'Bold'}, * result: rte => rte.exec('bold') * }); * rte.add('link', { @@ -231,7 +231,7 @@ module.exports = () => { * Triggered when the offset of the editor is changed * @private */ - udpatePosition() { + updatePosition() { const un = 'px'; const canvas = config.em.get('Canvas'); const pos = canvas.getTargetToElementDim(toolbar, lastEl, { @@ -272,10 +272,10 @@ module.exports = () => { rte = customRte ? customRte.enable(el, rte) : this.initRte(el).enable(); if (em) { - setTimeout(this.udpatePosition.bind(this), 0); + setTimeout(this.updatePosition.bind(this), 0); const event = 'change:canvasOffset canvasScroll'; - em.off(event, this.udpatePosition, this); - em.on(event, this.udpatePosition, this); + em.off(event, this.updatePosition, this); + em.on(event, this.updatePosition, this); em.trigger('rte:enable', view, rte); }