mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Api: Let legacy custom JS return
Legacy JS in the form app.appname.function where we _couldn't_ find the actual function now return. Fixes some custom click handlers couldn't submit
This commit is contained in:
parent
9cc0e6506b
commit
04ad3651a4
@ -99,6 +99,11 @@ export function et2_compileLegacyJS(_code, _widget, _context)
|
||||
}
|
||||
// Code is app.appname.function, add the arguments so it can be executed
|
||||
_code += '(ev,widget)';
|
||||
// Return what the function returns
|
||||
if(_code.indexOf("return") == -1)
|
||||
{
|
||||
_code = "return " + _code;
|
||||
}
|
||||
}
|
||||
// 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