X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffloatpanel%2Fplugin.js;h=178459e2ccd4f9ea78f259253cccce3e9b643012;hb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7;hp=6d5744203f47f8fada259f8f43c9057fcbab3c5e;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/floatpanel/plugin.js b/_source/plugins/floatpanel/plugin.js index 6d57442..178459e 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 ) @@ -203,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; @@ -259,13 +260,34 @@ CKEDITOR.plugins.add( 'floatpanel', if ( top + panelSize.height > viewportSize.height + windowScroll.y ) top -= panelSize.height; + // If IE is in RTL, we have troubles with absolute + // position and horizontal scrolls. Here we have a + // series of hacks to workaround it. (#6146) + if ( CKEDITOR.env.ie ) + { + var offsetParent = new CKEDITOR.dom.element( element.$.offsetParent ), + scrollParent = offsetParent; + + // Quirks returns , but standards returns . + if ( scrollParent.getName() == 'html' ) + scrollParent = scrollParent.getDocument().getBody(); + + if ( scrollParent.getComputedStyle( 'direction' ) == 'rtl' ) + { + // For IE8, there is not much logic on this, but it works. + if ( CKEDITOR.env.ie8Compat ) + left -= element.getDocument().getDocumentElement().$.scrollLeft * 2; + else + left -= ( offsetParent.$.scrollWidth - offsetParent.$.clientWidth ); + } + } + element.setStyles( { top : top + 'px', - left : left + 'px', - opacity : '1' + left : left + 'px' } ); - + element.setOpacity( 1 ); } , this ); panel.isLoaded ? panelLoad() : panel.onLoad = panelLoad;