Skip to content

Commit 813cec6

Browse files
committed
Merge branch 't/13138' into major
2 parents 27736b3 + 1fac62d commit 813cec6

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Fixed Issues:
88
* [#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.
99
* Toolbar configurators:
1010
* [#13185](http://dev.ckeditor.com/ticket/13185): Fixed: Wrong position of the suggestion box if there is not enough space below the caret.
11+
* [#13138](http://dev.ckeditor.com/ticket/13138): Fixed: The "Toggle empty elements" button label is unclear.
1112

1213
## CKEditor 4.5 Beta
1314

samples/toolbarconfigurator/js/abstracttoolbarmodifier.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,14 @@ if ( !Object.keys ) {
404404
* @private
405405
*/
406406
AbstractToolbarModifier.prototype._createToolbarBtn = function( cfg ) {
407-
var btn = ToolbarConfigurator.FullToolbarEditor.createButton( cfg.text, cfg.cssClass );
407+
var btnText = ( typeof cfg.text === 'string' ? cfg.text : cfg.text.inactive ),
408+
btn = ToolbarConfigurator.FullToolbarEditor.createButton( btnText, cfg.cssClass );
408409

409410
this.toolbarContainer.append( btn );
410411
btn.data( 'group', cfg.group );
411412
btn.addClass( cfg.position );
412413
btn.on( 'click', function() {
413-
cfg.clickCallback.call( this, btn );
414+
cfg.clickCallback.call( this, btn, cfg );
414415
}, this );
415416

416417
return btn;

samples/toolbarconfigurator/js/toolbarmodifier.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,25 @@
2525

2626
this.toolbarButtons = [
2727
{
28-
text: 'Toggle visibility of empty elements',
28+
text: {
29+
active: 'Hide empty toolbar groups',
30+
inactive: 'Show empty toolbar groups'
31+
},
2932
group: 'edit',
3033
position: 'left',
3134
cssClass: 'button-a-soft',
32-
clickCallback: function( button ) {
35+
clickCallback: function( button, buttonDefinition ) {
3336
var className = 'button-a-background';
3437

3538
button[ button.hasClass( className ) ? 'removeClass' : 'addClass' ]( className );
39+
3640
this._toggleVisibilityEmptyElements();
41+
42+
if ( this.emptyVisible ) {
43+
button.setText( buttonDefinition.text.active );
44+
} else {
45+
button.setText( buttonDefinition.text.inactive );
46+
}
3747
}
3848
},
3949
{

0 commit comments

Comments
 (0)