# HG changeset patch # User Edouard Tisserant # Date 1606916004 -3600 # Node ID 1ae4a871b6f9142e5f3c20cd86f284c8d68c756e # Parent 45f044cf845b45b5ae8eb5c167af6a4b1d867b5b SVGHMI: update generated XSLT diff -r 45f044cf845b -r 1ae4a871b6f9 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Wed Dec 02 14:32:56 2020 +0100 +++ b/svghmi/gen_index_xhtml.xslt Wed Dec 02 14:33:24 2020 +0100 @@ -3854,6 +3854,8 @@ do_http_request(...opt) { + console.log(opt); + const query = { args: this.args, @@ -3904,9 +3906,11 @@ make_on_click(...options){ + let that = this; + return function(evt){ - this.do_http_request(...options); + that.do_http_request(...options); } @@ -4009,7 +4013,7 @@ id(" - ").setAttribute("xlink:href", + ").setAttribute("xlink:href", "#"+hmi_widgets[" @@ -4107,9 +4111,9 @@ ").onclick = this.make_on_click(' - ', '"+ + ', - +"'); + ); @@ -4326,16 +4330,6 @@ }, - on_click: function(evt) { - - const index = this.indexes.length > 0 ? this.indexes[0] + this.offset : undefined; - - const name = this.args[0]; - - switch_page(name, index); - - }, - notify_page_change: function(page_name, index){ @@ -4350,11 +4344,25 @@ }, + make_on_click(){ + + let that = this; + + const name = this.args[0]; + + return function(evt){ + + const index = that.indexes.length > 0 ? that.indexes[0] + that.offset : undefined; + + switch_page(name, index); + + } + + }, + init: function() { - this.element.setAttribute("onclick", "hmi_widgets[' - - '].on_click(evt)"); + this.element.onclick = this.make_on_click(); this.active_elt_style = this.active_elt.getAttribute("style"); @@ -5976,7 +5984,7 @@ - +