From 0607b60bc9d819336df8561d0652b490eaf1d022 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 8 Dec 2014 17:04:41 +0000 Subject: [PATCH] Set a timeout to window resizer to make sure this happens after other resize events, hopefully fixes the timing issue --- etemplate/js/etemplate2.js | 43 +++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index cd766ba98b..dbdcdc297f 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -108,25 +108,30 @@ etemplate2.prototype.templates = {}; */ etemplate2.prototype.resize = function(e) { - if (this.widgetContainer) - { - var appHeader = $j('#divAppboxHeader'); - - //Calculate the excess height - var excess_height = egw(window).is_popup()? $j(window).height() - $j('.et2_container').height() - appHeader.outerHeight()+10: false; - - // Recalculate excess height if the appheader is shown, e.g. mobile framework dialogs - if (appHeader.length > 0 && appHeader.is(':visible')) excess_height -= appHeader.outerHeight()-9; - - if (typeof e != 'undefined' && e.type !== 'resize') excess_height = 0; - - // Call the "resize" event of all functions which implement the - // "IResizeable" interface - this.widgetContainer.iterateOver(function(_widget) { - - _widget.resize(excess_height); - }, this, et2_IResizeable); - } + var event = e; + var self = this; + setTimeout(function(){ + if (self.widgetContainer) + { + var appHeader = $j('#divAppboxHeader'); + + //Calculate the excess height + var excess_height = egw(window).is_popup()? $j(window).height() - $j('.et2_container').height() - appHeader.outerHeight()+10: false; + + // Recalculate excess height if the appheader is shown, e.g. mobile framework dialogs + if (appHeader.length > 0 && appHeader.is(':visible')) excess_height -= appHeader.outerHeight()-9; + + if (typeof event != 'undefined' && event.type !== 'resize') excess_height = 0; + + // Call the "resize" event of all functions which implement the + // "IResizeable" interface + self.widgetContainer.iterateOver(function(_widget) { + + _widget.resize(excess_height); + }, self, et2_IResizeable); + } + },100) + }; /**