Skip to content

Commit

Permalink
Merge branch 't/13138' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed May 4, 2015
2 parents 27736b3 + 1fac62d commit 813cec6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions samples/toolbarconfigurator/js/abstracttoolbarmodifier.js
Expand Up @@ -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;
Expand Down
14 changes: 12 additions & 2 deletions samples/toolbarconfigurator/js/toolbarmodifier.js
Expand Up @@ -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 );
}
}
},
{
Expand Down

0 comments on commit 813cec6

Please sign in to comment.