Browse Source

Move custom style manager

up-style-manager
Artur Arseniev 4 years ago
parent
commit
f03423ac81
  1. 4
      src/commands/view/OpenStyleManager.js
  2. 5
      src/style_manager/index.js
  3. 2
      src/style_manager/model/PropertyFactory.js

4
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 = $(`<div class="${pfx}header">${editor.t('styleManager.empty')}</div>`);

5
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) {

2
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 }],

Loading…
Cancel
Save