diff --git a/src/commands/view/OpenStyleManager.js b/src/commands/view/OpenStyleManager.js index 52c49e8b0..65ba2b0af 100644 --- a/src/commands/view/OpenStyleManager.js +++ b/src/commands/view/OpenStyleManager.js @@ -35,7 +35,9 @@ export default { const sm = editor.StyleManager; this.sm = sm; const smConfig = sm.getConfig(); - if (!smConfig.appendTo) { + if (smConfig.custom) { + sm.__trgCustom({ container: this.$cn2.get(0) }); + } else if (!smConfig.appendTo) { this.$cn2.append(sm.render()); const pfx = smConfig.stylePrefix; this.$header = $(`
${editor.t('styleManager.empty')}
`); diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 34d644c23..07483aecc 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -168,8 +168,9 @@ export default () => { this.__trgCustom(); }, - __trgCustom() { - this.em.trigger(this.events.custom); + __trgCustom(opts = {}) { + this.__ctn = this.__ctn || opts.container; + this.em.trigger(this.events.custom, { container: this.__ctn }); }, __trgEv(event, ...data) { diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 87b618a3d..2ab698f36 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -202,7 +202,7 @@ export default class PropertyFactory { ['background-color', { default: 'none' }, 'color'], // File type - ['background-image', { type: this.typeFile, functionName: 'url', default: 'none' }], + ['background-image', { type: this.typeFile, functionName: 'url', default: 'none', full: 1 }], // Slider type ['opacity', { type: this.typeSlider, default: '1', min: 0, max: 1, step: 0.01 }],