mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
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
a4199de696
commit
fcbe746755
@ -150,7 +150,11 @@
|
||||
// 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)
|
||||
{
|
||||
_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
|
||||
_code = _code.replace(/(window\.)?app\./, 'widget.getInstanceManager().app_obj.');
|
||||
|
Loading…
Reference in New Issue
Block a user