[BUGFIX] RTE: Incorrect dialog window height when browser zoom is used 35/36735/3
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 7 Feb 2015 23:41:56 +0000 (18:41 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 17:04:24 +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/36735
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/Resources/Public/JavaScript/HTMLArea/Plugin/Plugin.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/Abbreviation.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/EditElement.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/TableOperations.js

index bbb8b87..41f926c 100644 (file)
@@ -551,6 +551,20 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Plugin/Plugin',
                },
 
                /**
+                * 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 e2a46ea..5028eef 100644 (file)
@@ -147,7 +147,10 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/Abbreviation',
                                        },
                                        listeners: {
                                                tabchange: {
-                                                       fn: this.syncHeight,
+                                                       fn: function (tabpanel, tab) {
+                                                               this.setTabPanelHeight(tabpanel, tab);
+                                                               this.syncHeight(tabpanel, tab);
+                                                       },
                                                        scope: this
                                                }
                                        },
index 791f4ca..fea2ce0 100644 (file)
@@ -152,7 +152,10 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/EditElement',
                                        },
                                        listeners: {
                                                tabchange: {
-                                                       fn: this.syncHeight,
+                                                       fn: function (tabpanel, tab) {
+                                                               this.setTabPanelHeight(tabpanel, tab);
+                                                               this.syncHeight(tabpanel, tab);
+                                                       },
                                                        scope: this
                                                }
                                        },
index b981a7c..33a64e9 100644 (file)
@@ -336,7 +336,10 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/TableOperations',
                                        },
                                        listeners: {
                                                tabchange: {
-                                                       fn: this.syncHeight,
+                                                       fn: function (tabpanel, tab) {
+                                                               this.setTabPanelHeight(tabpanel, tab);
+                                                               this.syncHeight(tabpanel, tab);
+                                                       },
                                                        scope: this
                                                }
                                        },