JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6
[ckeditor.git] / _source / plugins / floatpanel / plugin.js
index 7e9af39..4a24dfa 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -207,16 +207,9 @@ CKEDITOR.plugins.add( 'floatpanel',
 \r
                                                        if ( block.autoSize )\r
                                                        {\r
-                                                               // We must adjust first the width or IE6 could include extra lines in the height computation\r
-                                                               var widthNode = block.element.$;\r
+                                                               var panelDoc = block.element.getDocument();\r
+                                                               var width = ( CKEDITOR.env.webkit? block.element : panelDoc.getBody() )[ '$' ].scrollWidth;\r
 \r
-                                                               if ( CKEDITOR.env.gecko || CKEDITOR.env.opera )\r
-                                                                       widthNode = widthNode.parentNode;\r
-\r
-                                                               if ( CKEDITOR.env.ie )\r
-                                                                       widthNode = widthNode.document.body;\r
-\r
-                                                               var width = widthNode.scrollWidth;\r
                                                                // Account for extra height needed due to IE quirks box model bug:\r
                                                                // http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug\r
                                                                // (#3426)\r