get form::name() legacy function working by making used et2_form_name function global, if used

This commit is contained in:
Ralf Becker 2021-08-19 10:22:40 +02:00
parent 9231b32fce
commit 1596bec75c

View File

@ -17,6 +17,7 @@
import {egw} from "../jsapi/egw_global";
import {et2_IDOMNode} from "./et2_core_interfaces";
import {et2_form_name} from "./et2_core_common";
export function et2_compileLegacyJS(_code, _widget, _context)
{
@ -144,7 +145,8 @@ function js_pseudo_funcs(_val,widget)
{
// et2_form_name doesn't care about ][, just [
var _cname = widget.getPath() ? widget.getPath().join("[") : false;
_val = _val.replace(/form::name\(/g, "'"+widget.getRoot()._inst.uniqueId+"_'+"+(_cname ? "et2_form_name('"+_cname+"'," : '('));
document.et2_form_name = et2_form_name;
_val = _val.replace(/form::name\(/g, "'"+widget.getRoot()._inst.uniqueId+"_'+"+(_cname ? "document.et2_form_name('"+_cname+"'," : '('));
}
if (_val.indexOf('egw::lang(') != -1)