|
|
|
@ -224,7 +224,7 @@ export default { |
|
|
|
|
|
|
|
toggleToolsEl(on, view, opts = {}) { |
|
|
|
const el = opts.el || this.canvas.getToolsEl(view); |
|
|
|
el && (el.style.opacity = on ? 1 : 0); |
|
|
|
el && (el.style.display = on ? '' : 'none'); |
|
|
|
return el || {}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -509,29 +509,19 @@ export default { |
|
|
|
* @param {Object} mod |
|
|
|
*/ |
|
|
|
updateToolbar(mod) { |
|
|
|
var em = this.config.em; |
|
|
|
var model = mod == em ? em.getSelected() : mod; |
|
|
|
var toolbarEl = this.canvas.getToolbarEl(); |
|
|
|
var toolbarStyle = toolbarEl.style; |
|
|
|
|
|
|
|
if (!model) { |
|
|
|
// By putting `toolbarStyle.display = 'none'` will cause kind
|
|
|
|
// of freezed effect with component selection (probably by iframe
|
|
|
|
// switching)
|
|
|
|
toolbarStyle.opacity = 0; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var toolbar = model.get('toolbar'); |
|
|
|
var showToolbar = em.get('Config').showToolbar; |
|
|
|
|
|
|
|
if (showToolbar && toolbar && toolbar.length) { |
|
|
|
toolbarStyle.opacity = ''; |
|
|
|
const { em } = this.config; |
|
|
|
const model = mod == em ? em.getSelected() : mod; |
|
|
|
const toolbarEl = this.canvas.getToolbarEl(); |
|
|
|
const toolbarStyle = toolbarEl.style; |
|
|
|
const toolbar = model.get('toolbar'); |
|
|
|
const showToolbar = em.get('Config').showToolbar; |
|
|
|
|
|
|
|
if (model && showToolbar && toolbar && toolbar.length) { |
|
|
|
toolbarStyle.display = ''; |
|
|
|
if (!this.toolbar) { |
|
|
|
toolbarEl.innerHTML = ''; |
|
|
|
this.toolbar = new Toolbar(toolbar); |
|
|
|
var toolbarView = new ToolbarView({ |
|
|
|
const toolbarView = new ToolbarView({ |
|
|
|
collection: this.toolbar, |
|
|
|
editor: this.editor, |
|
|
|
em |
|
|
|
|