Browse Source

Add get `getDirtyCount` method

pull/1042/merge
Artur Arseniev 8 years ago
parent
commit
a472d06beb
  1. 9
      src/editor/index.js
  2. 9
      src/editor/model/Editor.js

9
src/editor/index.js

@ -486,6 +486,15 @@ module.exports = config => {
return c.el;
},
/**
* Return the count of changes made to the content and not yet stored.
* This count resets at any `store()`
* @return {number}
*/
getDirtyCount() {
return em.getDirtyCount();
},
/**
* Update editor dimensions and refresh data useful for positioning of tools
*

9
src/editor/model/Editor.js

@ -467,6 +467,15 @@ module.exports = Backbone.Model.extend({
return device && width && !preview ? `(${condition}: ${width})` : '';
},
/**
* Return the count of changes made to the content and not yet stored.
* This count resets at any `store()`
* @return {number}
*/
getDirtyCount() {
return this.get('changesCount');
},
/**
* Set/get data from the HTMLElement
* @param {HTMLElement} el

Loading…
Cancel
Save