Browse Source

Add getSelectedToStyle to the editor API

pull/187/head
Artur Arseniev 9 years ago
parent
commit
cb29703963
  1. 16
      src/editor/index.js

16
src/editor/index.js

@ -311,6 +311,22 @@ module.exports = config => {
return em.getSelected();
},
/**
* Get stylable entity from the selected component.
* If you select the component without classes the entity is the Component
* itself and all changes will go inside its 'style' property. Otherwise,
* if the selected component has one or more classes, the function will
* return the corresponding CSS Rule
* @return {Model}
*/
getSelectedToStyle() {
let selected = em.getSelected();
if (selected) {
return this.StyleManager.getModelToStyle(selected);
}
},
/**
* Set device to the editor. If the device exists it will
* change the canvas to the proper width

Loading…
Cancel
Save