From d5652c2f7e31efba7558333147e7660b820f7ce8 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 15 Sep 2021 09:23:15 -0600 Subject: [PATCH] Bind app.appname.function context so widget can't lose it --- api/js/etemplate/et2_core_legacyJSFunctions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_core_legacyJSFunctions.ts b/api/js/etemplate/et2_core_legacyJSFunctions.ts index 87d6aee233..1f9d62c540 100644 --- a/api/js/etemplate/et2_core_legacyJSFunctions.ts +++ b/api/js/etemplate/et2_core_legacyJSFunctions.ts @@ -71,7 +71,8 @@ export function et2_compileLegacyJS(_code, _widget, _context) } } if (typeof parent[existing_func] === "function") { - return parent[existing_func]; + // Bind the object so no matter what happens, context is correct + return parent[existing_func].bind(parent); } }