Browse Source

Up RTE

pull/4746/head
Artur Arseniev 4 years ago
parent
commit
9dcbeadd4f
  1. 13
      src/rich_text_editor/index.ts
  2. 9
      src/rich_text_editor/model/RichTextEditor.ts

13
src/rich_text_editor/index.ts

@ -69,9 +69,10 @@ export default class RichTextEditorModule extends Module<RichTextEditorConfig &
super(em, 'RichTextEditor', defaults); super(em, 'RichTextEditor', defaults);
const { config } = this; const { config } = this;
const ppfx = config.pStylePrefix; const ppfx = config.pStylePrefix;
// if (ppfx) {
// config.stylePrefix = ppfx + config.stylePrefix; if (ppfx) {
// } config.stylePrefix = ppfx + config.stylePrefix;
}
this.pfx = config.stylePrefix!; this.pfx = config.stylePrefix!;
this.actions = config.actions || []; this.actions = config.actions || [];
@ -264,7 +265,7 @@ export default class RichTextEditorModule extends Module<RichTextEditorConfig &
* @return {HTMLElement} * @return {HTMLElement}
*/ */
getToolbarEl() { getToolbarEl() {
return toolbar; return this.toolbar;
} }
/** /**
@ -272,10 +273,10 @@ export default class RichTextEditorModule extends Module<RichTextEditorConfig &
* @private * @private
*/ */
updatePosition() { updatePosition() {
const { em } = this; const { em, toolbar } = this;
const un = 'px'; const un = 'px';
const canvas = em.get('Canvas'); const canvas = em.get('Canvas');
const { style } = this.toolbar; const { style } = toolbar;
const pos = canvas.getTargetToElementFixed(this.lastEl, toolbar, { const pos = canvas.getTargetToElementFixed(this.lastEl, toolbar, {
event: 'rteToolbarPosUpdate', event: 'rteToolbarPosUpdate',
left: 0, left: 0,

9
src/rich_text_editor/model/RichTextEditor.ts

@ -172,14 +172,7 @@ export default class RichTextEditor {
return this; return this;
} }
destroy() { destroy() {}
// this.el = 0;
// this.doc = 0;
// this.actionbar = 0;
// this.settings = {};
// this.classes = {};
// this.actions = [];
}
setEl(el: HTMLElement) { setEl(el: HTMLElement) {
this.el = el; this.el = el;

Loading…
Cancel
Save