JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.1
[ckeditor.git] / _source / plugins / floatpanel / plugin.js
index 0577222..178459e 100644 (file)
@@ -260,6 +260,28 @@ CKEDITOR.plugins.add( 'floatpanel',
                                                        if ( top + panelSize.height > viewportSize.height + windowScroll.y )\r
                                                                top -= panelSize.height;\r
 \r
+                                                       // If IE is in RTL, we have troubles with absolute\r
+                                                       // position and horizontal scrolls. Here we have a\r
+                                                       // series of hacks to workaround it. (#6146)\r
+                                                       if ( CKEDITOR.env.ie )\r
+                                                       {\r
+                                                               var offsetParent = new CKEDITOR.dom.element( element.$.offsetParent ),\r
+                                                                       scrollParent = offsetParent;\r
+\r
+                                                               // Quirks returns <body>, but standards returns <html>.\r
+                                                               if ( scrollParent.getName() == 'html' )\r
+                                                                       scrollParent = scrollParent.getDocument().getBody();\r
+\r
+                                                               if ( scrollParent.getComputedStyle( 'direction' ) == 'rtl' )\r
+                                                               {\r
+                                                                       // For IE8, there is not much logic on this, but it works.\r
+                                                                       if ( CKEDITOR.env.ie8Compat )\r
+                                                                               left -= element.getDocument().getDocumentElement().$.scrollLeft * 2;\r
+                                                                       else\r
+                                                                               left -= ( offsetParent.$.scrollWidth - offsetParent.$.clientWidth );\r
+                                                               }\r
+                                                       }\r
+\r
                                                        element.setStyles(\r
                                                                {\r
                                                                        top : top + 'px',\r