Fixed bug #16250: prototype methods are used to determine the available viewport...
authorSteffen Kamper <info@sk-typo3.de>
Sat, 6 Nov 2010 10:56:06 +0000 (10:56 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sat, 6 Nov 2010 10:56:06 +0000 (10:56 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9296 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/ux/Ext.ux.FitToParent.js

index 12d6a66..848de02 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-11-06  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16250: prototype methods are used to determine the available viewport dimensions in ExtJS plugins
        * Fixed bug #16254: Dead logo function in backend.php
        * Fixed bug #16116: Configuration module is hard to find the array key because it's not sorted
        * Fixed bug #15587: Bug: htmlspecialchars called twice (Thanks to Mickel Ricky)
index e4aa34c..69e77bc 100644 (file)
@@ -21,11 +21,20 @@ Ext.ux.plugins.FitToParent = Ext.extend(Object, {
                        c.doLayout = c.doLayout.createInterceptor(this.fitSizeToParent);\r
                }\r
        },\r
+\r
        fitSizeToParent : function() {\r
-               // Uses the dimension of the current viewport, but removes the document header\r
-               // and an addtional margin of 40 pixels (e.g. Safari needs this addition)\r
-               \r
-               this.fitToElement.setHeight(document.viewport.getHeight() - this.fitToElement.getTop() - 40);\r
+                       // Uses the dimension of the current viewport, but removes the document header\r
+               var documentHeaderHeight = 0;\r
+               var documentHeader = Ext.get('typo3-docheader');\r
+\r
+               if (Ext.isObject(documentHeader)) {\r
+                       documentHeaderHeight = documentHeader.getHeight();\r
+               }\r
+\r
+               this.fitToElement.setHeight(\r
+                       Ext.lib.Dom.getViewportHeight() - this.fitToElement.getTop() - documentHeaderHeight\r
+               );\r
+\r
                var pos = this.getPosition(true), size = this.fitToElement.getViewSize();\r
                this.setSize(size.width - pos[0], size.height - pos[1]);\r
                \r