[BUGFIX] RTE: Incorrect dialog window height when browser zoom is used 36/36736/2
authorStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 00:07:00 +0000 (19:07 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 17:04:06 +0000 (18:04 +0100)
Problem: When browser zoom is used, ExtJS does not calculate correctly the
height of tabpanels that contain fieldsets.
Solution: Calculate the correct height and set the tabpanel height.

Releases: master, 6.2
Resolves: #45616

Change-Id: I0bc6d95b6699378b19fe81df8aaab7915e933c4d
Reviewed-on: http://review.typo3.org/36736
Reviewed-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/EditElement/edit-element.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js

index c2bb071..adf630a 100644 (file)
@@ -6641,7 +6641,22 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
                        configArray.push(configElement);
                }
        },
-       /*
+
+       /**
+        * Handler for Ext.TabPanel afterrender and tabchange events
+        * Set height of the tabpanel (miscalculated when the brower zoom is in use)
+        * Working around ExtJS 3.1 bug
+        */
+       setTabPanelHeight: function (tabpanel, tab) {
+               var components = tab.findByType('fieldset');
+               var height = 0;
+               for (var i = components.length; --i >= 0;) {
+                       height += components[i].getEl().dom.offsetHeight;
+               }
+               tabpanel.setHeight(tabpanel.getFrameHeight() + height + tabpanel.findParentByType('window').footer.getHeight());
+       },
+
+       /**
         * Handler for Ext.TabPanel tabchange event
         * Force window ghost height synchronization
         * Working around ExtJS 3.1 bug
index 2a5b19d..917cfcc 100644 (file)
@@ -136,7 +136,10 @@ HTMLArea.Acronym = Ext.extend(HTMLArea.Plugin, {
                                },
                                listeners: {
                                        tabchange: {
-                                               fn: this.syncHeight,
+                                               fn: function (tabpanel, tab) {
+                                                       this.setTabPanelHeight(tabpanel, tab);
+                                                       this.syncHeight(tabpanel, tab);
+                                               },
                                                scope: this
                                        }
                                },
index 87aacb8..5f988ea 100644 (file)
@@ -134,7 +134,10 @@ HTMLArea.EditElement = Ext.extend(HTMLArea.Plugin, {
                                },
                                listeners: {
                                        tabchange: {
-                                               fn: this.syncHeight,
+                                               fn: function (tabpanel, tab) {
+                                                       this.setTabPanelHeight(tabpanel, tab);
+                                                       this.syncHeight(tabpanel, tab);
+                                               },
                                                scope: this
                                        }
                                },
index a73e3f3..49a76b7 100644 (file)
@@ -318,7 +318,10 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                },
                                listeners: {
                                        tabchange: {
-                                               fn: this.syncHeight,
+                                               fn: function (tabpanel, tab) {
+                                                       this.setTabPanelHeight(tabpanel, tab);
+                                                       this.syncHeight(tabpanel, tab);
+                                               },
                                                scope: this
                                        }
                                },