X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fshowborders%2Fplugin.js;h=5987be733e1fe136866cf2bf116765baf14b5c0d;hb=refs%2Ftags%2Fv3.2.1;hp=4fc46b6b7f3f51fd55ed8c2a9bfc9a63a395a70b;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/showborders/plugin.js b/_source/plugins/showborders/plugin.js index 4fc46b6..5987be7 100644 --- a/_source/plugins/showborders/plugin.js +++ b/_source/plugins/showborders/plugin.js @@ -129,36 +129,33 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } ); } + } + }); - // Table dialog must be aware of it. - CKEDITOR.on( 'dialogDefinition', function( ev ) - { - if ( ev.editor != editor ) - return; + // Table dialog must be aware of it. + CKEDITOR.on( 'dialogDefinition', function( ev ) + { + var dialogName = ev.data.name; - var dialogName = ev.data.name; + if ( dialogName == 'table' || dialogName == 'tableProperties' ) + { + var dialogDefinition = ev.data.definition, + infoTab = dialogDefinition.getContents( 'info' ), + borderField = infoTab.get( 'txtBorder' ), + originalCommit = borderField.commit; - if ( dialogName == 'table' || dialogName == 'tableProperties' ) + borderField.commit = CKEDITOR.tools.override( originalCommit, function( org ) + { + return function( data, selectedTable ) { - var dialogDefinition = ev.data.definition, - infoTab = dialogDefinition.getContents( 'info' ), - borderField = infoTab.get( 'txtBorder' ), - originalCommit = borderField.commit; - - borderField.commit = CKEDITOR.tools.override( originalCommit, function( org ) - { - return function( data, selectedTable ) - { - org.apply( this, arguments ); - var value = parseInt( this.getValue(), 10 ); - selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName ); - }; - } ); - } - }); + org.apply( this, arguments ); + var value = parseInt( this.getValue(), 10 ); + selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName ); + }; + } ); } - }); + } )(); /**