Skip to content

Commit

Permalink
[bugfix/145]Fix disabled button.
Browse files Browse the repository at this point in the history
Solution is parsing of every toolbars, then checking if the command is
'image'. If yes, put the button state at 'off' since button.getState
returns undefined
  • Loading branch information
Luc MULLER authored and CybotTM committed Dec 30, 2021
1 parent ef9164e commit 13b5c00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Resources/Public/JavaScript/Plugins/typo3image.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
$shadowEditor = $('<div>').append(editor.element.$.innerText),
existingImages = $shadowEditor.find('img');

editor.toolbar.forEach(function(toolbar){
if(toolbar.items){
toolbar.items.forEach(function(item){
if(item.command == 'image'){
item.setState(CKEDITOR.TRISTATE_OFF)
}
});
}
});

if (additionalAttributes.length) {
allowedAttributes.push.apply(allowedAttributes, additionalAttributes);
}
Expand Down

0 comments on commit 13b5c00

Please sign in to comment.