deprecated egw.includeJS() in favor of es6 import statement

with egw composition happening in main window the used import statement happens in that context and NOT in the window (eg. popup or iframe) this module is instantiated for!
This commit is contained in:
Ralf Becker
2021-07-09 17:27:22 +02:00
parent 4f95ebb510
commit a5ad691757
9 changed files with 12 additions and 62 deletions

View File

@ -161,7 +161,7 @@ egw.extend('lang', egw.MODULE_GLOBAL, function()
this.lang_order = apps.reverse();
}
const promise = files.includeJS(jss, _callback, _context || null);
const promise = Promise.all(jss.map((src) => import(src)));
return typeof _callback === 'function' ? promise.then(_callback.call(_context)) : promise;
}
};