mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
Fix tracking of opened popups not working after framework reload
This commit is contained in:
parent
c2c1bdb6ad
commit
2d71cdf0f5
@ -137,7 +137,6 @@ var fw_base = (function(){ "use strict"; return Class.extend(
|
||||
|
||||
this.applications[this.appData.appName] = this.appData;
|
||||
|
||||
this.popups.concat(this.registerOpenedPopups(app.name));
|
||||
}
|
||||
|
||||
// else display the default application
|
||||
@ -808,34 +807,6 @@ var fw_base = (function(){ "use strict"; return Class.extend(
|
||||
if (_returnID !== false) return windowID;
|
||||
},
|
||||
|
||||
registerOpenedPopups: function (_app)
|
||||
{
|
||||
var w = Object.keys(egw.getOpenWindows(_app));
|
||||
var popups = [];
|
||||
var popup;
|
||||
for (var i=0; i < w.length; i++)
|
||||
{
|
||||
try{
|
||||
popup = window.open('', w[i], '100x100');
|
||||
if (popup.location.href == "about:blank")
|
||||
{
|
||||
popup.close();
|
||||
egw(window).windowClosed(_app, popup);
|
||||
}
|
||||
if (popup && egw.is_popup(popup)) popups.push(popup);
|
||||
}catch(e)
|
||||
{
|
||||
if (popup)
|
||||
{
|
||||
popup.close();
|
||||
egw.windowClosed(_app, popup);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return popups;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if given window is a "popup" alike, returning integer or undefined if not
|
||||
*
|
||||
|
@ -224,6 +224,10 @@
|
||||
{
|
||||
// Timeout is 5 seconds, but it iks only applied(egw_utils) when something asks for the window list
|
||||
window.setInterval(function() {
|
||||
if (window.opener && window.opener.framework && typeof window.opener.framework.popup_idx(window) == 'undefined')
|
||||
{
|
||||
window.opener.framework.popups.push(window);
|
||||
}
|
||||
egw().storeWindow(this.egw_appName, this);
|
||||
}, 2000);
|
||||
}
|
||||
|
@ -270,12 +270,8 @@ egw.extend('utils', egw.MODULE_GLOBAL, function()
|
||||
*/
|
||||
storeWindow: function(appname, popup)
|
||||
{
|
||||
if (popup.opener) popup.opener.framework.popups_garbage_collector();
|
||||
if (popup.opener && popup.opener.framework && egw.is_popup(popup)
|
||||
&& typeof popup.opener.framework.popup_idx(popup) == 'undefined')
|
||||
{
|
||||
popup.opener.framework.popups.push(popup);
|
||||
}
|
||||
if (popup.opener && popup.opener.framework) popup.opener.framework.popups_garbage_collector();
|
||||
|
||||
// Don't store if it has no name
|
||||
if(!popup.name || ['_blank'].indexOf(popup.name) >= 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user