fix resize to work with zoom at least up to 125%, by calling resize a 2. time

This commit is contained in:
Ralf Becker 2014-11-28 14:01:13 +00:00
parent c03ec0679e
commit 9fdd92b5ea

View File

@ -214,17 +214,9 @@
window.framework.setSidebox.apply(window.framework, JSON.parse(sidebox)); window.framework.setSidebox.apply(window.framework, JSON.parse(sidebox));
} }
// rest needs DOM to be ready var resize_attempt = 0;
$j(function() { var resize_popup = function()
// load etemplate2 template(s)
$j('div.et2_container[data-etemplate]').each(function(index, node){
var data = JSON.parse(node.getAttribute('data-etemplate')) || {};
var currentapp = data.data.currentapp || window.egw_appName;
if(popup || window.opener)
{ {
// Resize popup when et2 load is done
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 = {
@ -241,9 +233,30 @@
} }
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+8, egw_getWindowOuterHeight() - delta_height+10);
} }
}, 200); // trigger a 2. resize, as one is not enough, if window is zoomed
if (delta_width && ++resize_attempt < 2)
{
window.setTimeout(resize_popup, 50);
}
else
{
resize_attempt = 0;
}
};
// rest needs DOM to be ready
$j(function() {
// load etemplate2 template(s)
$j('div.et2_container[data-etemplate]').each(function(index, node){
var data = JSON.parse(node.getAttribute('data-etemplate')) || {};
var currentapp = data.data.currentapp || window.egw_appName;
if(popup || window.opener)
{
// Resize popup when et2 load is done
jQuery(node).on('load', function() {
window.setTimeout(resize_popup, 50);
}); });
} }
var et2 = new etemplate2(node, currentapp+".etemplate_new.ajax_process_content.etemplate"); var et2 = new etemplate2(node, currentapp+".etemplate_new.ajax_process_content.etemplate");