X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fskins%2Foffice2003%2Fskin.js;h=61aee1e628c3e9f8b12870738bf6fb0e7f718d9f;hp=48a6bcd26ef8972e89da8bd4c72efccb5480745c;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/_source/skins/office2003/skin.js b/_source/skins/office2003/skin.js index 48a6bcd..61aee1e 100644 --- a/_source/skins/office2003/skin.js +++ b/_source/skins/office2003/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,54 +23,59 @@ CKEDITOR.skins.add( 'office2003', (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 != 'office2003' ) - 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 != 'office2003' ) + 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. - var fixSize = function() - { - var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ), - body = innerDialog.getChild( 0 ); + // Fix the size of the elements which have flexible lengths. + var fixSize = 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' ); - }; - setTimeout( fixSize, 100 ); + // mr + el = innerDialog.getChild( 5 ); + el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); + }; + setTimeout( fixSize, 100 ); - // Ensure size is correct for RTL mode. (#4003) - if ( evt.editor.lang.dir == 'rtl' ) - setTimeout( fixSize, 1000 ); - }); -} + // Ensure size is correct for RTL mode. (#4003) + if ( evt.editor.lang.dir == 'rtl' ) + setTimeout( fixSize, 1000 ); + }); + } +})();