mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-13 15:48:17 +01:00
Fix egw.json() calls from a popup could cause JS files to be loaded into the main window instead of the popup
This commit is contained in:
parent
bd84b18b7e
commit
770b1d79fd
@ -506,4 +506,14 @@ window.egw_rejoin = function ()
|
||||
}, 5000);
|
||||
});
|
||||
}.bind(window), 500);
|
||||
}
|
||||
/**
|
||||
* Allow egw.json to load JS into popups
|
||||
*
|
||||
* @param url
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
window.egw_import = function (url)
|
||||
{
|
||||
return import(url);
|
||||
}
|
@ -346,8 +346,9 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
if(js_files.length > 0)
|
||||
{
|
||||
var start_time = (new Date).getTime();
|
||||
// for some reason using this.includeJS() does NOT work / app.classes does not get set, before the Promise resolves
|
||||
Promise.all(js_files.map((file) => import(file))).then(() => {
|
||||
// Need to use this.egw.window.egw_import() to make sure file is loaded in correct window
|
||||
Promise.all(js_files.map((file) => this.egw.window.egw_import(file))).then(() =>
|
||||
{
|
||||
var end_time = (new Date).getTime();
|
||||
this.handleResponse(data);
|
||||
if (egw.preference('show_generation_time', 'common', false) == "1")
|
||||
|
Loading…
Reference in New Issue
Block a user