Skip to content

Commit 59b9683

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-97483' into 2.3-develop-pr15
2 parents 20a998d + ba4bd08 commit 59b9683

File tree

1 file changed

+8
-8
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/element

1 file changed

+8
-8
lines changed

app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ define([
1818
'use strict';
1919

2020
return Abstract.extend({
21+
currentWysiwyg: undefined,
2122
defaults: {
2223
elementSelector: 'textarea',
2324
suffixRegExpPattern: '${ $.wysiwygUniqueSuffix }',
@@ -53,6 +54,10 @@ define([
5354

5455
// disable editor completely after initialization is field is disabled
5556
varienGlobalEvents.attachEventHandler('wysiwygEditorInitialized', function () {
57+
if (!_.isUndefined(window.tinyMceEditors)) {
58+
this.currentWysiwyg = window.tinyMceEditors[this.wysiwygId];
59+
}
60+
5661
if (this.disabled()) {
5762
this.setDisabled(true);
5863
}
@@ -136,14 +141,9 @@ define([
136141
}
137142

138143
/* 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);
147147
}
148148
}
149149
});

0 commit comments

Comments
 (0)