X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fskins%2Fv2%2Fskin.js;h=f7d5060133e79c13bb02023351ae2783e7c37e95;hp=3e93628368ac3142af8e4d01e4b13ca63236fce9;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/_source/skins/v2/skin.js b/_source/skins/v2/skin.js index 3e93628..f7d5060 100644 --- a/_source/skins/v2/skin.js +++ b/_source/skins/v2/skin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -23,50 +23,55 @@ CKEDITOR.skins.add( 'v2', (function() }; })() ); -if ( CKEDITOR.dialog ) +(function() { - CKEDITOR.dialog.on( 'resize', function( evt ) - { - var data = evt.data, - width = data.width, - height = data.height, - dialog = data.dialog, - contents = dialog.parts.contents; + CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup ); - if ( data.skin != 'v2' ) - return; + function dialogSetup() + { + CKEDITOR.dialog.on( 'resize', function( evt ) + { + var data = evt.data, + width = data.width, + height = data.height, + dialog = data.dialog, + contents = dialog.parts.contents; + + if ( data.skin != 'v2' ) + return; - contents.setStyles( - { - width : width + 'px', - height : height + 'px' - }); + contents.setStyles( + { + width : width + 'px', + height : height + 'px' + }); - if ( !CKEDITOR.env.ie ) - return; + if ( !CKEDITOR.env.ie ) + return; - // Fix the size of the elements which have flexible lengths. - setTimeout( function() - { - var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ), - body = innerDialog.getChild( 0 ); + // Fix the size of the elements which have flexible lengths. + setTimeout( function() + { + var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ), + body = innerDialog.getChild( 0 ); - // tc - var el = innerDialog.getChild( 2 ); - el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' ); + // tc + var el = innerDialog.getChild( 2 ); + el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' ); - // bc - el = innerDialog.getChild( 7 ); - el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' ); + // bc + el = innerDialog.getChild( 7 ); + el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' ); - // ml - el = innerDialog.getChild( 4 ); - el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); + // ml + el = innerDialog.getChild( 4 ); + el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); - // mr - el = innerDialog.getChild( 5 ); - el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); - }, - 100 ); - }); -} + // mr + el = innerDialog.getChild( 5 ); + el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); + }, + 100 ); + }); + } +})();