Skip to content

Commit a2c290d

Browse files
committed
MAGETWO-83682: Fix js error when disable/enable wysiwyg editor #12141
- Merge Pull Request #12141 from vovayatsyuk/magento2:fix-wysiwyg-disable-enable-method - Merged commits: 1. 032316d 2. 3b139c4
2 parents 7648220 + 3b139c4 commit a2c290d

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

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

Lines changed: 3 additions & 2 deletions
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)