Browse Source

Add selector:update event

pull/2474/head
Artur Arseniev 7 years ago
parent
commit
489bcaa595
  1. 1
      src/editor/index.js
  2. 8
      src/selector_manager/index.js

1
src/editor/index.js

@ -76,6 +76,7 @@
* ### Selectors
* * `selector:add` - New selector is add. Passes the new selector as an argument
* * `selector:remove` - Selector removed. Passes the removed selector as an argument
* * `selector:update` - Selector updated. Passes the updated selector as an argument
* ### RTE
* * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument
* * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument

8
src/selector_manager/index.js

@ -104,6 +104,14 @@ export default config => {
selectors = new Selectors(c.selectors);
selectors.on('add', model => em.trigger('selector:add', model));
selectors.on('remove', model => em.trigger('selector:remove', model));
selectors.on('change', model =>
em.trigger(
'selector:update',
model,
model.previousAttributes(),
model.changedAttributes()
)
);
return this;
},

Loading…
Cancel
Save