JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.1
[ckeditor.git] / _source / plugins / maximize / plugin.js
index 957d991..2258c5a 100644 (file)
@@ -87,6 +87,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                };\r
        }\r
 \r
+       function refreshCursor( editor )\r
+       {\r
+               if ( editor.focusManager.hasFocus )\r
+               {\r
+                       var focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml(\r
+                               '<span tabindex="-1" style="position:absolute; left:-10000" role="presentation"></span>' ) );\r
+\r
+                       focusGrabber.on( 'focus', function()\r
+                               {\r
+                                       editor.focus();\r
+                               } );\r
+                       focusGrabber.focus();\r
+                       focusGrabber.remove();\r
+               }\r
+       }\r
+\r
        CKEDITOR.plugins.add( 'maximize',\r
        {\r
                init : function( editor )\r
@@ -190,6 +206,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        top : ( -1 * offset.y ) + 'px'\r
                                                                } );\r
 \r
+                                                       // Fixing positioning editor chrome in Firefox break design mode. (#5149)\r
+                                                       CKEDITOR.env.gecko && refreshCursor( editor );\r
+\r
                                                        // Add cke_maximized class.\r
                                                        container.addClass( 'cke_maximized' );\r
                                                }\r
@@ -242,6 +261,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                {\r
                                                        if ( savedSelection )\r
                                                        {\r
+                                                               // Fixing positioning editor chrome in Firefox break design mode. (#5149)\r
+                                                               CKEDITOR.env.gecko && refreshCursor( editor );\r
+\r
                                                                editor.getSelection().selectRanges(savedSelection);\r
                                                                var element = editor.getSelection().getStartElement();\r
                                                                element && element.scrollIntoView( true );\r