SVGHMI: Fix browser side exception when some widget are not used, and are then discarded and not present in final SVG. In that case JS code was still making reference to discarded widget elements and was raising exception at init. svghmi
authorEdouard Tisserant
Tue, 26 Jan 2021 11:17:08 +0100
branchsvghmi
changeset 3119 17a9c7a334f7
parent 3118 e704b0487515
child 3120 7ecaefe38f6f
child 3121 8094494113b6
SVGHMI: Fix browser side exception when some widget are not used, and are then discarded and not present in final SVG. In that case JS code was still making reference to discarded widget elements and was raising exception at init.
svghmi/widgets_common.ysl2
--- a/svghmi/widgets_common.ysl2	Tue Jan 26 11:14:22 2021 +0100
+++ b/svghmi/widgets_common.ysl2	Tue Jan 26 11:17:08 2021 +0100
@@ -289,7 +289,7 @@
 ||
 
 const "excluded_types", "str:split('Page Lang VarInit')";
-const "included_ids","$parsed_widgets/widget[not(@type = $excluded_types)]/@id";
+const "included_ids","$parsed_widgets/widget[not(@type = $excluded_types) and not(@id = $discardable_elements/@id)]/@id";
 
 emit "declarations:hmi-elements" {
     | var hmi_widgets = {