making popup resize a bit more relyable by using an extra timeout and trigger it for every load, not just first one

This commit is contained in:
Ralf Becker 2014-10-30 11:10:03 +00:00
parent 2cb639dd9c
commit 6b1c36f6d3

View File

@ -223,7 +223,8 @@
if(popup || window.opener) if(popup || window.opener)
{ {
// Resize popup when et2 load is done // Resize popup when et2 load is done
jQuery(node).one("load",function() { jQuery(node).on("load",function() {
window.setTimeout(function() {
var $main_div = $j('#popupMainDiv'); var $main_div = $j('#popupMainDiv');
var $et2 = $j('.et2_container'); var $et2 = $j('.et2_container');
var w = { var w = {
@ -234,11 +235,11 @@
// to take padding/margin into account // to take padding/margin into account
var delta_width = w.width - ($et2.outerWidth(true) + ($main_div.outerWidth(true) - $main_div.width())); var delta_width = w.width - ($et2.outerWidth(true) + ($main_div.outerWidth(true) - $main_div.width()));
var delta_height = w.height - ($et2.outerHeight(true) + ($main_div.outerHeight(true) - $main_div.height())); var delta_height = w.height - ($et2.outerHeight(true) + ($main_div.outerHeight(true) - $main_div.height()));
debugger;
if(delta_width != 0 || delta_height != 0) if(delta_width != 0 || delta_height != 0)
{ {
window.resizeTo(egw_getWindowOuterWidth() - delta_width,egw_getWindowOuterHeight() - delta_height); window.resizeTo(egw_getWindowOuterWidth() - delta_width,egw_getWindowOuterHeight() - delta_height);
} }
}, 200);
}); });
} }
var et2 = new etemplate2(node, currentapp+".etemplate_new.ajax_process_content.etemplate"); var et2 = new etemplate2(node, currentapp+".etemplate_new.ajax_process_content.etemplate");