SVGHMI: move declaration of "xmlns" javascript const so that widgets can use it.
authorEdouard Tisserant
Thu, 24 Nov 2022 11:47:56 +0100
changeset 3690 f41733be17a8
parent 3689 0e886fcc56f9
child 3691 9289fdda0222
SVGHMI: move declaration of "xmlns" javascript const so that widgets can use it.

This was broken in earlier commit, when changing initial execution order because of implementing websocket reconnect.
svghmi/inline_svg.ysl2
svghmi/svghmi.js
--- a/svghmi/inline_svg.ysl2	Thu Nov 24 10:54:58 2022 +0100
+++ b/svghmi/inline_svg.ysl2	Thu Nov 24 11:47:56 2022 +0100
@@ -209,6 +209,7 @@
 const "result_svg_ns", "exsl:node-set($result_svg)";
 
 emit "preamble:inline-svg" {
+    | const xmlns = "http://www.w3.org/2000/svg";
     | let id = document.getElementById.bind(document);
     | var svg_root = id("«$svg/@id»");
 }
--- a/svghmi/svghmi.js	Thu Nov 24 10:54:58 2022 +0100
+++ b/svghmi/svghmi.js	Thu Nov 24 11:47:56 2022 +0100
@@ -666,7 +666,6 @@
 
 create_ws()
 
-const xmlns = "http://www.w3.org/2000/svg";
 var edit_callback;
 const localtypes = {"PAGE_LOCAL":null, "HMI_LOCAL":null}
 function edit_value(path, valuetype, callback, initial) {