Browse Source

Mare the rte toolbar hidden on render. Closes #461

pull/487/head
Artur Arseniev 8 years ago
parent
commit
45804f39da
  1. 4
      src/canvas/view/CanvasView.js
  2. 14
      src/rich_text_editor/index.js

4
src/canvas/view/CanvasView.js

@ -121,13 +121,13 @@ module.exports = Backbone.View.extend({
var frameCss = ` var frameCss = `
${baseCss} ${baseCss}
.${ppfx}dashed :not([contenteditable]) > *[data-highlightable] { .${ppfx}dashed *[data-highlightable] {
outline: 1px dashed rgba(170,170,170,0.7); outline: 1px dashed rgba(170,170,170,0.7);
outline-offset: -2px outline-offset: -2px
} }
.${ppfx}comp-selected { .${ppfx}comp-selected {
outline: 3px solid #3b97e3 !important outline: 3px solid #3b97e3 !important;
} }
.${ppfx}comp-selected-parent { .${ppfx}comp-selected-parent {

14
src/rich_text_editor/index.js

@ -21,6 +21,14 @@ module.exports = () => {
const defaults = require('./config/config'); const defaults = require('./config/config');
let toolbar, actions, lastEl, globalRte; let toolbar, actions, lastEl, globalRte;
const hideToolbar = () => {
const style = toolbar.style;
const size = '-100px';
style.top = size;
style.left = size;
style.display = 'none';
};
return { return {
customRte: null, customRte: null,
@ -72,6 +80,7 @@ module.exports = () => {
postRender(ev) { postRender(ev) {
const canvas = ev.model.get('Canvas'); const canvas = ev.model.get('Canvas');
toolbar.style.pointerEvents = 'all'; toolbar.style.pointerEvents = 'all';
hideToolbar();
canvas.getToolsEl().appendChild(toolbar); canvas.getToolsEl().appendChild(toolbar);
}, },
@ -266,7 +275,6 @@ module.exports = () => {
disable(view, rte) { disable(view, rte) {
const em = config.em; const em = config.em;
const customRte = this.customRte; const customRte = this.customRte;
const style = toolbar.style;
var el = view.getChildrenContainer(); var el = view.getChildrenContainer();
if (customRte) { if (customRte) {
@ -275,9 +283,7 @@ module.exports = () => {
rte.disable(); rte.disable();
} }
style.display = 'none'; hideToolbar();
style.top = 0;
style.left = 0;
em && em.trigger('rte:disable', view, rte); em && em.trigger('rte:disable', view, rte);
}, },
}; };

Loading…
Cancel
Save