forked from extern/egroupware
dynamic load app.js file for "app.$app.$func" type handlers, if not already loaded
so eg. a config.xet run by admin app could call a handler from the apps own app.js
This commit is contained in:
parent
6f160fe4b2
commit
235f1ba8ec
@ -150,7 +150,11 @@
|
|||||||
// Code is app.appname.function, add the arguments so it can be executed
|
// 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)
|
if (typeof _code == 'string' && _code.indexOf('app') == 0 && _code.split('.').length >= 3 && _code.indexOf('(') == -1)
|
||||||
{
|
{
|
||||||
_code += '(ev,widget)';
|
return function(ev)
|
||||||
|
{
|
||||||
|
const app = widget.getInstanceManager().app_obj;
|
||||||
|
return egw.applyFunc(_code, [ev, _widget], context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// use app object from etemplate2, which might be private and not just window.app
|
// use app object from etemplate2, which might be private and not just window.app
|
||||||
_code = _code.replace(/(window\.)?app\./, 'widget.getInstanceManager().app_obj.');
|
_code = _code.replace(/(window\.)?app\./, 'widget.getInstanceManager().app_obj.');
|
||||||
|
Loading…
Reference in New Issue
Block a user