Browse Source

Added check to ensure acitonBar existed

pull/2429/head
adriangroch 7 years ago
parent
commit
93b3067a74
  1. 20
      src/rich_text_editor/model/RichTextEditor.js

20
src/rich_text_editor/model/RichTextEditor.js

@ -195,15 +195,17 @@ export default class RichTextEditor {
*/ */
syncActions() { syncActions() {
this.getActions().forEach(action => { this.getActions().forEach(action => {
if ( if (this.settings.actionbar) {
!action.state || if (
(action.state && action.state(this, this.doc) >= 0) !action.state ||
) { (action.state && action.state(this, this.doc) >= 0)
const event = action.event || 'click'; ) {
action.btn[`on${event}`] = e => { const event = action.event || 'click';
action.result(this, action); action.btn[`on${event}`] = e => {
this.updateActiveActions(); action.result(this, action);
}; this.updateActiveActions();
};
}
} }
}); });
} }

Loading…
Cancel
Save