JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / maximize / plugin.js
index fa2f791..5b405d0 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -194,10 +194,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        container.setCustomData( 'maximize_saved_styles', saveStyles( container, true ) );\r
 \r
                                                        // Hide scroll bars.\r
-                                                       var viewPaneSize = mainWindow.getViewPaneSize();\r
                                                        var styles =\r
                                                                {\r
-                                                                       overflow : 'hidden',\r
+                                                                       overflow : CKEDITOR.env.webkit ? '' : 'hidden',         // #6896\r
                                                                        width : 0,\r
                                                                        height : 0\r
                                                                };\r
@@ -268,6 +267,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        // Remove cke_maximized class.\r
                                                        container.removeClass( 'cke_maximized' );\r
 \r
+                                                       // Webkit requires a re-layout on editor chrome. (#6695)\r
+                                                       if ( CKEDITOR.env.webkit )\r
+                                                       {\r
+                                                               container.setStyle( 'display', 'inline' );\r
+                                                               setTimeout( function(){ container.setStyle( 'display', 'block' ); }, 0 );\r
+                                                       }\r
+\r
                                                        if ( shim )\r
                                                        {\r
                                                                shim.remove();\r
@@ -283,12 +289,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                                // Toggle button label.\r
                                                var button = this.uiItems[ 0 ];\r
-                                               var label = ( this.state == CKEDITOR.TRISTATE_OFF )\r
-                                                       ? lang.maximize : lang.minimize;\r
-                                               var buttonNode = editor.element.getDocument().getById( button._.id );\r
-                                               buttonNode.getChild( 1 ).setHtml( label );\r
-                                               buttonNode.setAttribute( 'title', label );\r
-                                               buttonNode.setAttribute( 'href', 'javascript:void("' + label + '");' );\r
+                                               // Only try to change the button if it exists (#6166)\r
+                                               if( button )\r
+                                               {\r
+                                                       var label = ( this.state == CKEDITOR.TRISTATE_OFF )\r
+                                                               ? lang.maximize : lang.minimize;\r
+                                                       var buttonNode = editor.element.getDocument().getById( button._.id );\r
+                                                       buttonNode.getChild( 1 ).setHtml( label );\r
+                                                       buttonNode.setAttribute( 'title', label );\r
+                                                       buttonNode.setAttribute( 'href', 'javascript:void("' + label + '");' );\r
+                                               }\r
 \r
                                                // Restore selection and scroll position in editing area.\r
                                                if ( editor.mode == 'wysiwyg' )\r