* Mail/Admin: fix not working mail wizard

caused by loading app.js again and therefore this.et2 is not set --> only load / use egw.applyFunc() if not already set
This commit is contained in:
Ralf Becker 2021-05-25 18:25:11 +02:00
parent d733cb48e9
commit 5ca7452613

View File

@ -149,13 +149,20 @@
try {
// Code is app.appname.function, add the arguments so it can be executed
if (typeof _code == 'string' && _code.indexOf('app') == 0 && _code.split('.').length >= 3 && _code.indexOf('(') == -1)
{
const parts = _code.split('.');
const app = _widget.getInstanceManager().app_obj;
// check if we need to load the object
if (parts.length === 3 && typeof app[parts[1]] === 'undefined')
{
return function (ev, widget)
{
const app = widget.getInstanceManager().app_obj;
return egw.applyFunc(_code, [ev, _widget], context);
return egw.applyFunc(_code, [ev, widget]);
}
}
// Code is app.appname.function, add the arguments so it can be executed
_code += '(ev,widget)';
}
// use app object from etemplate2, which might be private and not just window.app
_code = _code.replace(/(window\.)?app\./, 'widget.getInstanceManager().app_obj.');