JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2
[ckeditor.git] / _source / plugins / floatpanel / plugin.js
index 849d5fc..6d57442 100644 (file)
@@ -158,10 +158,10 @@ CKEDITOR.plugins.add( 'floatpanel',
                                                        // the blur event may get fired even when focusing\r
                                                        // inside the window itself, so we must ensure the\r
                                                        // target is out of it.\r
-                                                       var target = ev.data.getTarget(),\r
-                                                               targetWindow = target.getWindow && target.getWindow();\r
-\r
-                                                       if ( targetWindow && targetWindow.equals( focused ) )\r
+                                                       var target;\r
+                                                       if ( CKEDITOR.env.ie && !this.allowBlur()\r
+                                                                || ( target = ev.data.getTarget() )\r
+                                                                     && target.getName && target.getName() != 'iframe' )\r
                                                                return;\r
 \r
                                                        if ( this.visible && !this._.activeChild && !isShowing )\r
@@ -182,9 +182,10 @@ CKEDITOR.plugins.add( 'floatpanel',
                                        this._.blurSet = 1;\r
                                }\r
 \r
-                               panel.onEscape = CKEDITOR.tools.bind( function()\r
+                               panel.onEscape = CKEDITOR.tools.bind( function( keystroke )\r
                                        {\r
-                                               this.onEscape && this.onEscape();\r
+                                               if ( this.onEscape && this.onEscape( keystroke ) === false )\r
+                                                       return false;\r
                                        },\r
                                        this );\r
 \r
@@ -271,24 +272,11 @@ CKEDITOR.plugins.add( 'floatpanel',
 \r
                                                // Set the panel frame focus, so the blur event gets fired.\r
                                                CKEDITOR.tools.setTimeout( function()\r
-                                                       {\r
-                                                               if ( definition.voiceLabel )\r
-                                                               {\r
-                                                                       if ( CKEDITOR.env.gecko )\r
-                                                                       {\r
-                                                                               var container = iframe.getParent();\r
-                                                                               container.setAttribute( 'role', 'region' );\r
-                                                                               container.setAttribute( 'title', definition.voiceLabel );\r
-                                                                               iframe.setAttribute( 'role', 'region' );\r
-                                                                               iframe.setAttribute( 'title', ' ' );\r
-                                                                       }\r
-                                                               }\r
-\r
-                                                               iframe.$.contentWindow.focus();\r
-                                                               // We need this get fired manually because of unfired focus() function.\r
-                                                               this.allowBlur( true );\r
-\r
-                                                       }, 0, this);\r
+                                               {\r
+                                                       iframe.$.contentWindow.focus();\r
+                                                       // We need this get fired manually because of unfired focus() function.\r
+                                                       this.allowBlur( true );\r
+                                               }, 0, this);\r
                                        }, 0, this);\r
                                this.visible = 1;\r
 \r