Permalink
Browse files

BUGFIX Fixed resizing problem with LeftAndMain.js->resizeChildren() c…

…aused by jQuery UI tabs and FOUC

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92774 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 2683a5a commit 4decff99077cf8c6574352267be5819235bdc613 @chillu chillu committed Nov 21, 2009
Showing with 15 additions and 9 deletions.
  1. +15 −9 javascript/LeftAndMain.js
View
24 javascript/LeftAndMain.js
@@ -58,23 +58,29 @@ var ss_MainLayout;
this._setupPinging();
this._resizeChildren();
- // artificially delay the resize event 200ms
- // to avoid overlapping height changes in different onresize() methods
+ // HACK Delay resizing to give jquery-ui tabs a change their dimensions
+ // through dynamically added css classes
$(window).resize(function () {
var timerID = "timerLeftAndMainResize";
if (window[timerID]) clearTimeout(window[timerID]);
- window[timerID] = setTimeout(function() {self._resizeChildren();}, 200);
+ window[timerID] = setTimeout(function() {
+ self._resizeChildren();
+ }, 200);
});
// If tab has no nested tabs, set overflow to auto
$(this).find('.tab').not(':has(.tab)').css('overflow', 'auto');
-
- // trigger resize whenever new tabs are shown
- // @todo This is called multiple times when tabs are loaded
- this.find('.ss-tabset').live('tabsshow', function() {self._resizeChildren();});
-
+
// @todo Doesn't resize properly if the response doesn't contain a tabset (see above)
- //$('#Form_EditForm').bind('loadnewpage', function() {self._resizeChildren();});
+ $('#Form_EditForm').bind('loadnewpage', function() {
+ // HACK Delay resizing to give jquery-ui tabs a change their dimensions
+ // through dynamically added css classes
+ var timerID = "timerLeftAndMainResize";
+ if (window[timerID]) clearTimeout(window[timerID]);
+ window[timerID] = setTimeout(function() {
+ self._resizeChildren();
+ }, 200);
+ });
this._super();
},

0 comments on commit 4decff9

Please sign in to comment.