From 865c238e78cff3e08920fd6ac60748ca26631522 Mon Sep 17 00:00:00 2001 From: Theo Wu Date: Fri, 5 Jan 2018 11:55:23 -0800 Subject: [PATCH] When disableEditing is true, enable editing via toolbars. --- src/js/extensions/button.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/js/extensions/button.js b/src/js/extensions/button.js index ecca0d8e6..b40b2d2df 100644 --- a/src/js/extensions/button.js +++ b/src/js/extensions/button.js @@ -167,7 +167,17 @@ var action = this.getAction(); if (action) { - this.execAction(action); + if (this.getEditorOption('disableEditing')) { + this.getEditorElements().forEach(function (element) { + element.setAttribute('contentEditable', 'true'); + }); + this.execAction(action); + this.getEditorElements().forEach(function (element) { + element.setAttribute('contentEditable', 'inherit'); + }); + } else { + this.execAction(action); + } } },