X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fshowborders%2Fplugin.js;h=921920646219d406d29a82a07085841dd199cf75;hp=e7e9eecfb321a62961ae712febe66fcdc80a6283;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab diff --git a/_source/plugins/showborders/plugin.js b/_source/plugins/showborders/plugin.js index e7e9eec..9219206 100644 --- a/_source/plugins/showborders/plugin.js +++ b/_source/plugins/showborders/plugin.js @@ -161,6 +161,32 @@ For licensing, see LICENSE.html or http://ckeditor.com/license selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName ); }; } ); + + var advTab = dialogDefinition.getContents( 'advanced' ), + classField = advTab && advTab.get( 'advCSSClasses' ); + + if ( classField ) + { + classField.setup = CKEDITOR.tools.override( classField.setup, function( originalSetup ) + { + return function() + { + originalSetup.apply( this, arguments ); + this.setValue( this.getValue().replace( /cke_show_border/, '' ) ); + }; + }); + + classField.commit = CKEDITOR.tools.override( classField.commit, function( originalCommit ) + { + return function( data, element ) + { + originalCommit.apply( this, arguments ); + + if ( !parseInt( element.getAttribute( 'border' ), 10 ) ) + element.addClass( 'cke_show_border' ); + }; + }); + } } });