Skip to content

Commit

Permalink
Fixed "api.setActive is not a funcion"
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Aug 23, 2023
1 parent 37f44a2 commit 3a2ff97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/mage/adminhtml/wysiwyg/tinymce/plugins/openmagewidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ tinymce.PluginManager.add('openmagewidget', (ed, url) => {
let onSetup = function (api) {
// Add a node change handler, selects the button in the UI when a image is selected
editor.on('NodeChange', function (e) {
api.setActive(false);
if (api.setActive) api.setActive(false);
var n = e.target;
if (n.id && n.nodeName == 'IMG') {
var widgetCode = Base64.idDecode(n.id);
if (widgetCode.indexOf('{{widget') != -1) {
api.setActive(true);
if (api.setActive) api.setActive(true);
}
}
});
Expand Down

0 comments on commit 3a2ff97

Please sign in to comment.