- // Whenever a button is added or removed, check if we should show or
- // hide the corresponding plugin settings. (Note that upon
- // initialization, each button that already is part of the toolbar still
- // is considered "added", hence it also works correctly for buttons that
- // were added previously.)
- $context
- .find('.ckeditor-toolbar-active')
- .off('CKEditorToolbarChanged.ckeditorAdminPluginSettings')
- .on('CKEditorToolbarChanged.ckeditorAdminPluginSettings', function (event, action, button) {
- var $pluginSettings = $ckeditorPluginSettings
- .find('[data-ckeditor-buttons~=' + button + ']');
-
- // No settings for this button.
- if ($pluginSettings.length === 0) {
- return;
- }
+ $context.find('.ckeditor-toolbar-active').off('CKEditorToolbarChanged.ckeditorAdminPluginSettings').on('CKEditorToolbarChanged.ckeditorAdminPluginSettings', function (event, action, button) {
+ var $pluginSettings = $ckeditorPluginSettings.find('[data-ckeditor-buttons~=' + button + ']');