Skip to content

Commit

Permalink
Move away from deprecated sendAction function
Browse files Browse the repository at this point in the history
This closes #160.
  • Loading branch information
backspace committed Jun 9, 2020
1 parent 96b2925 commit 42cfe9b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions addon/components/mobiledoc-editor/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ export default Component.extend({
let serializeVersion = this.get('serializeVersion');
let updatedMobileDoc = editor.serialize(serializeVersion);
this._localMobiledoc = updatedMobileDoc;
this.sendAction('on-change', updatedMobileDoc); // eslint-disable-line ember/closure-actions

if (this['on-change']) {
this['on-change'](updatedMobileDoc);
}
},

inputModeDidChange(editor) {
Expand Down Expand Up @@ -397,11 +400,15 @@ export default Component.extend({
},

willCreateEditor() {
this.sendAction(WILL_CREATE_EDITOR_ACTION); // eslint-disable-line ember/closure-actions
if (this[WILL_CREATE_EDITOR_ACTION]) {
this[WILL_CREATE_EDITOR_ACTION]();
}
},

didCreateEditor(editor) {
this.sendAction(DID_CREATE_EDITOR_ACTION, editor); // eslint-disable-line ember/closure-actions
if (this[DID_CREATE_EDITOR_ACTION]) {
this[DID_CREATE_EDITOR_ACTION](editor);
}
},

_addAtom(atomName, text, payload) {
Expand Down

0 comments on commit 42cfe9b

Please sign in to comment.