X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fdialog%2Fplugin.js;h=13f632719684082337990ceab0de6d28c1aa0105;hp=d7086161bde0ed1aace413e2fdca2b2a9d2b5113;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/plugins/dialog/plugin.js b/_source/plugins/dialog/plugin.js index d708616..13f6327 100644 --- a/_source/plugins/dialog/plugin.js +++ b/_source/plugins/dialog/plugin.js @@ -33,6 +33,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; (function() { + var cssLength = CKEDITOR.tools.cssLength; function isTabVisible( tabId ) { return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight; @@ -501,7 +502,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; page && this.addPage( page ); } - this.parts['tabs'].on( 'click', function( evt ) + this.parts[ 'tabs' ].on( 'click', function( evt ) { var target = evt.data.getTarget(); // If we aren't inside a tab, bail out. @@ -990,26 +991,23 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; page.setAttribute( 'aria-hidden', i != id ); } - var selected = this._.tabs[id]; - selected[0].addClass( 'cke_dialog_tab_selected' ); + var selected = this._.tabs[ id ]; + selected[ 0 ].addClass( 'cke_dialog_tab_selected' ); - // [IE] a unvisible input[type='text'] will enlarge it's width - // if it's value is long when it show( #5649 ) - // so we clear it's value before it shows and then recover it + // [IE] an invisible input[type='text'] will enlarge it's width + // if it's value is long when it shows, so we clear it's value + // before it shows and then recover it (#5649) if ( CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ) { - clearOrRecoverTextInputValue( selected[1] ); - selected[1].show(); + clearOrRecoverTextInputValue( selected[ 1 ] ); + selected[ 1 ].show(); setTimeout( function() { - clearOrRecoverTextInputValue( selected[1], true ); + clearOrRecoverTextInputValue( selected[ 1 ], 1 ); }, 0 ); } else - { - selected[1].show(); - } - + selected[ 1 ].show(); this._.currentTabId = id; this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); @@ -1817,9 +1815,10 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; function showCover( editor ) { var win = CKEDITOR.document.getWindow(); - var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white', - backgroundCoverOpacity = editor.config.dialog_backgroundCoverOpacity, - baseFloatZIndex = editor.config.baseFloatZIndex, + var config = editor.config, + backgroundColorStyle = config.dialog_backgroundCoverColor || 'white', + backgroundCoverOpacity = config.dialog_backgroundCoverOpacity, + baseFloatZIndex = config.baseFloatZIndex, coverKey = CKEDITOR.tools.genKey( backgroundColorStyle, backgroundCoverOpacity, @@ -2250,14 +2249,14 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; if ( widths ) { if ( widths[i] ) - styles.push( 'width:' + CKEDITOR.tools.cssLength( widths[i] ) ); + styles.push( 'width:' + cssLength( widths[i] ) ); } else styles.push( 'width:' + Math.floor( 100 / childHtmlList.length ) + '%' ); if ( height ) - styles.push( 'height:' + CKEDITOR.tools.cssLength( height ) ); + styles.push( 'height:' + cssLength( height ) ); if ( elementDefinition && elementDefinition.padding != undefined ) - styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) ); + styles.push( 'padding:' + cssLength( elementDefinition.padding ) ); if ( styles.length > 0 ) html.push( 'style="' + styles.join('; ') + '" ' ); html.push( '>', childHtmlList[i], '' ); @@ -2310,7 +2309,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; */ vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { - if (arguments.length < 3 ) + if ( arguments.length < 3 ) return; this._ || ( this._ = {} ); @@ -2325,7 +2324,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; html.push( 'style="' ); if ( elementDefinition && elementDefinition.expand ) html.push( 'height:100%;' ); - html.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ), ';' ); + html.push( 'width:' + cssLength( width || '100%' ), ';' ); html.push( '"' ); html.push( 'align="', CKEDITOR.tools.htmlEncode( ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' ); @@ -2336,13 +2335,13 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; var styles = []; html.push( ' 0 ) html.push( 'style="', styles.join( '; ' ), '" ' ); html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '' );