JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / maximize / plugin.js
index 4c40544..a3a260a 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -114,7 +114,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        editorFocus : false,\r
                                        exec : function()\r
                                        {\r
-                                               var container = editor.container.getChild( [ 0, 0 ] );\r
+                                               var container = editor.container.getChild( 0 );\r
                                                var contents = editor.getThemeSpace( 'contents' );\r
 \r
                                                // Save current selection and scroll position in editing area.\r
@@ -165,8 +165,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        } );\r
                                                        }\r
 \r
-                                                       // Scroll to the top left.\r
-                                                       mainWindow.$.scrollTo( 0, 0 );\r
+                                                       // Scroll to the top left (IE needs some time for it - #4923).\r
+                                                       CKEDITOR.env.ie ?\r
+                                                               setTimeout( function() { mainWindow.$.scrollTo( 0, 0 ); }, 0 ) :\r
+                                                               mainWindow.$.scrollTo( 0, 0 );\r
 \r
                                                        // Resize and move to top left.\r
                                                        var viewPaneSize = mainWindow.getViewPaneSize();\r
@@ -212,7 +214,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        }\r
 \r
                                                        // Restore the window scroll position.\r
-                                                       mainWindow.$.scrollTo( outerScroll.x, outerScroll.y );\r
+                                                       CKEDITOR.env.ie ?\r
+                                                               setTimeout( function() { mainWindow.$.scrollTo( outerScroll.x, outerScroll.y ); }, 0 ) :\r
+                                                               mainWindow.$.scrollTo( outerScroll.x, outerScroll.y );\r
 \r
                                                        // Remove cke_maximized class.\r
                                                        container.removeClass( 'cke_maximized' );\r