File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
app/code/Magento/Ui/view/base/web/js/form/element Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ define([
18
18
'use strict' ;
19
19
20
20
return Abstract . extend ( {
21
+ currentWysiwyg : undefined ,
21
22
defaults : {
22
23
elementSelector : 'textarea' ,
23
24
suffixRegExpPattern : '${ $.wysiwygUniqueSuffix }' ,
@@ -53,6 +54,10 @@ define([
53
54
54
55
// disable editor completely after initialization is field is disabled
55
56
varienGlobalEvents . attachEventHandler ( 'wysiwygEditorInitialized' , function ( ) {
57
+ if ( ! _ . isUndefined ( window . tinyMceEditors ) ) {
58
+ this . currentWysiwyg = window . tinyMceEditors [ this . wysiwygId ] ;
59
+ }
60
+
56
61
if ( this . disabled ( ) ) {
57
62
this . setDisabled ( true ) ;
58
63
}
@@ -136,14 +141,9 @@ define([
136
141
}
137
142
138
143
/* eslint-disable no-undef */
139
- if ( typeof wysiwyg !== 'undefined' && wysiwyg . activeEditor ( ) ) {
140
- if ( wysiwyg && disabled ) {
141
- wysiwyg . setEnabledStatus ( false ) ;
142
- wysiwyg . getPluginButtons ( ) . prop ( 'disabled' , 'disabled' ) ;
143
- } else if ( wysiwyg ) {
144
- wysiwyg . setEnabledStatus ( true ) ;
145
- wysiwyg . getPluginButtons ( ) . removeProp ( 'disabled' ) ;
146
- }
144
+ if ( ! _ . isUndefined ( this . currentWysiwyg ) && this . currentWysiwyg . activeEditor ( ) ) {
145
+ this . currentWysiwyg . setEnabledStatus ( ! disabled ) ;
146
+ this . currentWysiwyg . getPluginButtons ( ) . prop ( 'disabled' , disabled ) ;
147
147
}
148
148
}
149
149
} ) ;
You can’t perform that action at this time.
0 commit comments