Browse Source

Add removeSector in StyleManager

pull/652/head
Artur Arseniev 9 years ago
parent
commit
0d9ce2ab95
  1. 26
      src/style_manager/index.js
  2. 1
      src/style_manager/view/SectorView.js

26
src/style_manager/index.js

@ -1,18 +1,4 @@
/**
*
* * [addSector](#addsector)
* * [getSector](#getsector)
* * [getSectors](#getsectors)
* * [addProperty](#addproperty)
* * [getProperty](#getproperty)
* * [getProperties](#getproperties)
* * [getModelToStyle](#getmodeltostyle)
* * [addType](#addtype)
* * [getType](#gettype)
* * [getTypes](#gettypes)
* * [createType](#createtype)
* * [render](#render)
*
* With Style Manager you basically build categories (called sectors) of CSS properties which could
* be used to custom components and classes.
* You can init the editor with all sectors and properties via configuration
@ -146,6 +132,18 @@ module.exports = () => {
},
/**
* Remove a sector by id
* @param {string} id Sector id
* @return {Sector} Removed sector
* @example
* const removed = styleManager.removeSector('mySector');
*/
removeSector(id) {
return this.getSectors().remove(this.getSector(id));
},
/**
* Get all sectors
* @return {Sectors} Collection of sectors

1
src/style_manager/view/SectorView.js

@ -23,6 +23,7 @@ module.exports = Backbone.View.extend({
const model = this.model;
this.listenTo(model, 'change:open', this.updateOpen);
this.listenTo(model, 'updateVisibility', this.updateVisibility);
this.listenTo(model, 'destroy remove', this.remove);
},
/**

Loading…
Cancel
Save