X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffloatpanel%2Fplugin.js;h=05772223c46c5a835ca21db4992d0dd25d787cd9;hb=055b6b0792ce7dc53d47af606b367c04b927c2ab;hp=849d5fc6945f453358e815b7acff179813ec72f1;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_source/plugins/floatpanel/plugin.js b/_source/plugins/floatpanel/plugin.js index 849d5fc..0577222 100644 --- a/_source/plugins/floatpanel/plugin.js +++ b/_source/plugins/floatpanel/plugin.js @@ -129,14 +129,15 @@ CKEDITOR.plugins.add( 'floatpanel', element.setStyles( { - top : top + 'px', - left : '-3000px', - opacity : '0', // FF3 is ignoring "visibility" + top : '-30000px', display : '' }); + // Don't use display or visibility style because we need to + // calculate the rendering layout later and focus the element. + element.setOpacity( 0 ); // To allow the context menu to decrease back their width - element.getFirst().removeStyle('width'); + element.getFirst().removeStyle( 'width' ); // Configure the IFrame blur event. Do that only once. if ( !this._.blurSet ) @@ -158,10 +159,10 @@ CKEDITOR.plugins.add( 'floatpanel', // the blur event may get fired even when focusing // inside the window itself, so we must ensure the // target is out of it. - var target = ev.data.getTarget(), - targetWindow = target.getWindow && target.getWindow(); - - if ( targetWindow && targetWindow.equals( focused ) ) + var target; + if ( CKEDITOR.env.ie && !this.allowBlur() + || ( target = ev.data.getTarget() ) + && target.getName && target.getName() != 'iframe' ) return; if ( this.visible && !this._.activeChild && !isShowing ) @@ -182,9 +183,10 @@ CKEDITOR.plugins.add( 'floatpanel', this._.blurSet = 1; } - panel.onEscape = CKEDITOR.tools.bind( function() + panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) { - this.onEscape && this.onEscape(); + if ( this.onEscape && this.onEscape( keystroke ) === false ) + return false; }, this ); @@ -202,10 +204,10 @@ CKEDITOR.plugins.add( 'floatpanel', // We must adjust first the width or IE6 could include extra lines in the height computation var widthNode = block.element.$; - if ( CKEDITOR.env.gecko || CKEDITOR.env.opera) + if ( CKEDITOR.env.gecko || CKEDITOR.env.opera ) widthNode = widthNode.parentNode; - if ( CKEDITOR.env.ie) + if ( CKEDITOR.env.ie ) widthNode = widthNode.document.body; var width = widthNode.scrollWidth; @@ -261,34 +263,20 @@ CKEDITOR.plugins.add( 'floatpanel', element.setStyles( { top : top + 'px', - left : left + 'px', - opacity : '1' + left : left + 'px' } ); - + element.setOpacity( 1 ); } , this ); panel.isLoaded ? panelLoad() : panel.onLoad = panelLoad; // Set the panel frame focus, so the blur event gets fired. CKEDITOR.tools.setTimeout( function() - { - if ( definition.voiceLabel ) - { - if ( CKEDITOR.env.gecko ) - { - var container = iframe.getParent(); - container.setAttribute( 'role', 'region' ); - container.setAttribute( 'title', definition.voiceLabel ); - iframe.setAttribute( 'role', 'region' ); - iframe.setAttribute( 'title', ' ' ); - } - } - - iframe.$.contentWindow.focus(); - // We need this get fired manually because of unfired focus() function. - this.allowBlur( true ); - - }, 0, this); + { + iframe.$.contentWindow.focus(); + // We need this get fired manually because of unfired focus() function. + this.allowBlur( true ); + }, 0, this); }, 0, this); this.visible = 1;