Bind app.appname.function context so widget can't lose it

This commit is contained in:
nathan 2021-09-15 09:23:15 -06:00
parent decd64e7c3
commit d5652c2f7e

View File

@ -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);
}
}