Browse Source

Rename style-clear in style-signature

pull/1518/head
Artur Arseniev 7 years ago
parent
commit
bfc9f1254d
  1. 2
      src/commands/view/ComponentStyleClear.js
  2. 4
      src/dom_components/model/Component.js
  3. 2
      src/dom_components/view/ComponentsView.js

2
src/commands/view/ComponentStyleClear.js

@ -10,7 +10,7 @@ module.exports = {
if (!len) {
const rules = ed.CssComposer.getAll();
let toClear = target.get('style-clear');
let toClear = target.get('style-signature');
toClear = isArray(toClear) ? toClear : [toClear];
rules.forEach(rule => {

4
src/dom_components/model/Component.js

@ -62,7 +62,7 @@ const avoidInline = em => em && em.getConfig('avoidInlineStyle');
* will be hidden from the style manager. Default: `true`
* @property {Array<String>} [stylable-require=[]] Indicate an array of style properties to show up which has been marked as `toRequire`. Default: `[]`
* @property {Array<String>} [unstylable=[]] Indicate an array of style properties which should be hidden from the style manager. Default: `[]`
* @property {Array<String>} [style-clear=''] This option comes handy when you need to remove component-specific rules. The editor will remove rules when there are no components, of that type, in the canvas. Eg. '['.navbar', '[navbar-']'. Default: `''`
* @property {Array<String>} [style-signature=''] This option comes handy when you need to remove or export strictly component-specific rules. Be default, if this option is not empty, the editor will remove rules when there are no components, of that type, in the canvas. Eg. '['.navbar', '[navbar-']'. Default: `''`
* @property {Boolean} [highlightable=true] It can be highlighted with 'dotted' borders if true. Default: `true`
* @property {Boolean} [copyable=true] True if it's possible to clone the component. Default: `true`
* @property {Boolean} [resizable=false] Indicates if it's possible to resize the component. It's also possible to pass an object as [options for the Resizer](https://github.com/artf/grapesjs/blob/master/src/utils/Resizer.js). Default: `false`
@ -95,7 +95,7 @@ const Component = Backbone.Model.extend(Styleable).extend(
badgable: true,
stylable: true,
'stylable-require': '',
'style-clear': '',
'style-signature': '',
unstylable: '',
highlightable: true,
copyable: true,

2
src/dom_components/view/ComponentsView.js

@ -19,7 +19,7 @@ module.exports = Backbone.View.extend({
const children = view.childrenView;
children && children.stopListening();
if (em) {
removed.get('style-clear') &&
removed.get('style-signature') &&
em
.get('Commands')
.run('core:component-style-clear', { target: removed });

Loading…
Cancel
Save