Skip to content

Commit b55f200

Browse files
author
Oleksii Korshenko
authored
MAGETWO-83682: Fix js error when disable/enable wysiwyg editor #12141
2 parents 791a253 + a2c290d commit b55f200

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ define([
4545
component: this,
4646
selector: 'button'
4747
}, function (element) {
48-
this.$wysiwygEditorButton = $(element);
48+
this.$wysiwygEditorButton = this.$wysiwygEditorButton ?
49+
this.$wysiwygEditorButton.add($(element)) : $(element);
4950
}.bind(this));
5051

5152
return this;
@@ -94,7 +95,7 @@ define([
9495
this.$wysiwygEditorButton.attr('disabled', status);
9596

9697
/* eslint-disable no-undef */
97-
if (tinyMCE) {
98+
if (tinyMCE && tinyMCE.activeEditor) {
9899
_.each(tinyMCE.activeEditor.controlManager.controls, function (property, index, controls) {
99100
controls[property.id].setDisabled(status);
100101
});

0 commit comments

Comments
 (0)