commit e450c22ea8e5ed458a295c37890fea4e31ea4a41
parent 5106e4a4d7633d29aa077200dadb5e16a8a68758
Author: unitehenry <unitehenry@gmail.com>
Date: Thu, 7 Nov 2019 08:24:54 -0500
responsive toolbar state instantiation
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/striveneditor.js b/src/striveneditor.js
@@ -490,6 +490,12 @@ export default class StrivenEditor {
body.onfocus = (e) => {
!this.browser.isEdge() && this.setRange();
+ // disables all states
+ this.options.toolbarOptions.forEach(opt => {
+ document.queryCommandState(opt) && this.executeCommand(opt);
+ })
+
+ // enable only active states
this.getActiveOptions().forEach(opt => {
!document.queryCommandState(opt) && this.executeCommand(opt);
})