Skip to content

Commit

Permalink
destroy medium editor after done using it (Fixes #1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed May 15, 2017
1 parent be07a2c commit af80926
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/core/interfaces/wysiwyg/interface.js
Expand Up @@ -78,14 +78,19 @@ define(['core/UIView', 'core/interfaces/wysiwyg/vendor/medium-editor.min'], func
};
},
afterRender: function () {
new MediumEditor('#wysiwyg-interface_' + this.options.name, {
this.editor = new MediumEditor('#wysiwyg-interface_' + this.options.name, {
toolbar: {
buttons: this.options.settings.get('buttons').split(',').map(function (buttonName) {
return buttonTypes[buttonName];
})
},
anchorPreview: false
});
},
cleanup: function () {
if (this.editor) {
this.editor.destroy();
}
}
});
});

0 comments on commit af80926

Please sign in to comment.