svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2898 a2910281fcb5
parent 2897 bf8a39cc65e4
child 2899 f1baf2d0552c
--- a/svghmi/gen_index_xhtml.xslt	Wed Mar 25 13:36:04 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Wed Mar 25 13:56:04 2020 +0100
@@ -876,7 +876,9 @@
     <xsl:param name="hmi_element"/>
     <xsl:text>    on_click: function(evt) {
 </xsl:text>
-    <xsl:text>        switch_page(this.args[0], this.indexes[0]);
+    <xsl:text>        const index = this.indexes.length &gt; 0 ? this.indexes[0] + this.offset : undefined;
+</xsl:text>
+    <xsl:text>        switch_page(this.args[0], index);
 </xsl:text>
     <xsl:text>    },
 </xsl:text>