diff --git a/CHANGES.md b/CHANGES.md index 0aed7289c23..d38e9bac89a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Fixed Issues: * [#13118](http://dev.ckeditor.com/ticket/13118): Fixed: The [`editor.getSelectedHtml()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getSelectedHtml) method throws error when called in the source mode. * Toolbar configurators: * [#13185](http://dev.ckeditor.com/ticket/13185): Fixed: Wrong position of the suggestion box if there is not enough space below the caret. + * [#13138](http://dev.ckeditor.com/ticket/13138): Fixed: The "Toggle empty elements" button label is unclear. ## CKEditor 4.5 Beta diff --git a/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js b/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js index 81bf44011aa..87e882debc3 100644 --- a/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +++ b/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js @@ -404,13 +404,14 @@ if ( !Object.keys ) { * @private */ AbstractToolbarModifier.prototype._createToolbarBtn = function( cfg ) { - var btn = ToolbarConfigurator.FullToolbarEditor.createButton( cfg.text, cfg.cssClass ); + var btnText = ( typeof cfg.text === 'string' ? cfg.text : cfg.text.inactive ), + btn = ToolbarConfigurator.FullToolbarEditor.createButton( btnText, cfg.cssClass ); this.toolbarContainer.append( btn ); btn.data( 'group', cfg.group ); btn.addClass( cfg.position ); btn.on( 'click', function() { - cfg.clickCallback.call( this, btn ); + cfg.clickCallback.call( this, btn, cfg ); }, this ); return btn; diff --git a/samples/toolbarconfigurator/js/toolbarmodifier.js b/samples/toolbarconfigurator/js/toolbarmodifier.js index b6af552a32b..f96b4ac55db 100644 --- a/samples/toolbarconfigurator/js/toolbarmodifier.js +++ b/samples/toolbarconfigurator/js/toolbarmodifier.js @@ -25,15 +25,25 @@ this.toolbarButtons = [ { - text: 'Toggle visibility of empty elements', + text: { + active: 'Hide empty toolbar groups', + inactive: 'Show empty toolbar groups' + }, group: 'edit', position: 'left', cssClass: 'button-a-soft', - clickCallback: function( button ) { + clickCallback: function( button, buttonDefinition ) { var className = 'button-a-background'; button[ button.hasClass( className ) ? 'removeClass' : 'addClass' ]( className ); + this._toggleVisibilityEmptyElements(); + + if ( this.emptyVisible ) { + button.setText( buttonDefinition.text.active ); + } else { + button.setText( buttonDefinition.text.inactive ); + } } }, {