mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-09 08:25:03 +02:00
fix async loading caused app.js not being loaded before et2.load() tried to instantiate it
This commit is contained in:
@ -521,17 +521,10 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
// check if we need a not yet included app.js object --> include it now and return a Promise
|
||||
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'undefined')
|
||||
{
|
||||
const self = this;
|
||||
return new Promise(function(resolve, reject)
|
||||
{
|
||||
// cache for a day, better then no invalidation
|
||||
self.includeJS('/'+parts[1]+'/js/app.js?'+((new Date).valueOf()/86400|0).toString(), function ()
|
||||
{
|
||||
resolve(self.applyFunc(_func, args, _context));
|
||||
}, self, self.webserverUrl);
|
||||
});
|
||||
this.includeJS('/'+parts[1]+'/js/app.js', undefined, undefined, this.webserverUrl)
|
||||
.then(() => this.applyFunc(_func, args, _context));
|
||||
}
|
||||
// check if we need a not yet instanciated app.js object --> instanciate it now
|
||||
// check if we need a not yet instantiated app.js object --> instantiate it now
|
||||
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'function')
|
||||
{
|
||||
parent = parent[parts[1]] = new app.classes[parts[1]]();
|
||||
|
Reference in New Issue
Block a user