mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-16 03:34:48 +02: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:
@ -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 is app.appname.function, add the arguments so it can be executed
|
||||||
_code += '(ev,widget)';
|
_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
|
// 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.');
|
||||||
|
Reference in New Issue
Block a user