From 93b3067a7430a7aa75072a15958d09d6da13c808 Mon Sep 17 00:00:00 2001 From: adriangroch Date: Tue, 10 Dec 2019 12:13:15 +1100 Subject: [PATCH] Added check to ensure acitonBar existed --- src/rich_text_editor/model/RichTextEditor.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/rich_text_editor/model/RichTextEditor.js b/src/rich_text_editor/model/RichTextEditor.js index 3fb22e043..597a3f787 100644 --- a/src/rich_text_editor/model/RichTextEditor.js +++ b/src/rich_text_editor/model/RichTextEditor.js @@ -195,15 +195,17 @@ export default class RichTextEditor { */ syncActions() { this.getActions().forEach(action => { - if ( - !action.state || - (action.state && action.state(this, this.doc) >= 0) - ) { - const event = action.event || 'click'; - action.btn[`on${event}`] = e => { - action.result(this, action); - this.updateActiveActions(); - }; + if (this.settings.actionbar) { + if ( + !action.state || + (action.state && action.state(this, this.doc) >= 0) + ) { + const event = action.event || 'click'; + action.btn[`on${event}`] = e => { + action.result(this, action); + this.updateActiveActions(); + }; + } } }); }