26d8f097a58c995c7137c7f707dd4b3f109e64c1
[ckeditor.git] / _source / skins / v2 / skin.js
1 /*
2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
4 */
5
6 CKEDITOR.skins.add( 'v2', (function()
7 {
8 return {
9 editor : { css : [ 'editor.css' ] },
10 dialog : { css : [ 'dialog.css' ] },
11 separator : { canGroup: false },
12 templates : { css : [ 'templates.css' ] },
13 margins : [ 0, 14, 18, 14 ]
14 };
15 })() );
16
17 (function()
18 {
19 CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
20
21 function dialogSetup()
22 {
23 CKEDITOR.dialog.on( 'resize', function( evt )
24 {
25 var data = evt.data,
26 width = data.width,
27 height = data.height,
28 dialog = data.dialog,
29 contents = dialog.parts.contents;
30
31 if ( data.skin != 'v2' )
32 return;
33
34 contents.setStyles(
35 {
36 width : width + 'px',
37 height : height + 'px'
38 });
39
40 if ( !CKEDITOR.env.ie || CKEDITOR.env.ie9Compat )
41 return;
42
43 // Fix the size of the elements which have flexible lengths.
44 setTimeout( function()
45 {
46 var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
47 body = innerDialog.getChild( 0 ),
48 bodyWidth = body.getSize( 'width' );
49 height += body.getChild( 0 ).getSize( 'height' ) + 1;
50
51 // tc
52 var el = innerDialog.getChild( 2 );
53 el.setSize( 'width', bodyWidth );
54
55 // bc
56 el = innerDialog.getChild( 7 );
57 el.setSize( 'width', bodyWidth - 28 );
58
59 // ml
60 el = innerDialog.getChild( 4 );
61 el.setSize( 'height', height );
62
63 // mr
64 el = innerDialog.getChild( 5 );
65 el.setSize( 'height', height );
66 },
67 100 );
68 });
69 }
70 })();