Browse Source

Merge branch 'dev' of https://github.com/artf/grapesjs into dev

pull/2090/head
Artur Arseniev 7 years ago
parent
commit
300e600532
  1. 10
      src/rich_text_editor/index.js

10
src/rich_text_editor/index.js

@ -138,7 +138,7 @@ module.exports = () => {
* @example
* rte.add('bold', {
* icon: '<b>B</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);
}

Loading…
Cancel
Save