--- a/svghmi/gen_index_xhtml.xslt Wed Aug 26 14:27:54 2020 +0200
+++ b/svghmi/gen_index_xhtml.xslt Thu Aug 27 09:59:35 2020 +0200
@@ -1510,8 +1510,6 @@
<xsl:text> if (this.active_style && this.inactive_style) {
- <xsl:text> console.log("pressedi...")
<xsl:text> this.active_elt.setAttribute("style", this.active_style);
<xsl:text> this.inactive_elt.setAttribute("style", "display:none");
@@ -1520,8 +1518,6 @@
<xsl:text> this.apply_hmi_value(0, 1);
- <xsl:text> console.log("pressed")
<xsl:text> // TODO inhibit all mouse/touch events except mouse up (in other word grab cursor)
@@ -1532,8 +1528,6 @@
<xsl:text> if (this.active_style && this.inactive_style) {
- <xsl:text> console.log("unpressedi...")
<xsl:text> this.active_elt.setAttribute("style", "display:none");
<xsl:text> this.inactive_elt.setAttribute("style", this.inactive_style);
@@ -1542,8 +1536,6 @@
<xsl:text> this.apply_hmi_value(0, 0);
- <xsl:text> console.log("unpressed")
<xsl:text> // TODO release inhibited events
@@ -3403,8 +3395,6 @@
<xsl:text> .then(res => res.json())
- <xsl:text> .then(function(res){console.log(res);return res;})
<xsl:text> .then(this.spread_json_data.bind(this));
@@ -4115,13 +4105,15 @@
<xsl:text> let coercedval = (typeof this.initial) == "number" ? Number(this.editstr) : this.editstr;
- <xsl:text> if(isNaN(coercedval)){
+ <xsl:text> if(typeof coercedval == 'number' && isNaN(coercedval)){ + <xsl:text> // revert to initial so it explicitely shows input was ignored <xsl:text> this.editstr = String(this.initial);
<xsl:text> this.update();
- <xsl:text> } else { // revert to initial so it explicitely shows input was ignored
<xsl:text> let callback_obj = this.result_callback_obj;
--- a/svghmi/widget_keypad.ysl2 Wed Aug 26 14:27:54 2020 +0200
+++ b/svghmi/widget_keypad.ysl2 Thu Aug 27 09:59:35 2020 +0200
@@ -89,10 +89,11 @@
let coercedval = (typeof this.initial) == "number" ? Number(this.editstr) : this.editstr;
+ if(typeof coercedval == 'number' && isNaN(coercedval)){ + // revert to initial so it explicitely shows input was ignored this.editstr = String(this.initial);
- } else { // revert to initial so it explicitely shows input was ignored
let callback_obj = this.result_callback_obj;
callback_obj.edit_callback(coercedval);