SVGHMI: Fix HMI:DropDown flicker on close.
--- a/svghmi/gen_index_xhtml.xslt Tue Apr 14 17:31:45 2020 +0200
+++ b/svghmi/gen_index_xhtml.xslt Tue Apr 14 19:22:18 2020 +0200
@@ -991,18 +991,18 @@
</xsl:text>
<xsl:text> close: function(){
</xsl:text>
+ <xsl:text> document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true);
+</xsl:text>
<xsl:text> this.reset_text();
</xsl:text>
<xsl:text> this.reset_box();
</xsl:text>
<xsl:text> this.element.appendChild(this.button_elt);
</xsl:text>
+ <xsl:text> this.opened = false;
+</xsl:text>
<xsl:text> this.apply_cache();
</xsl:text>
- <xsl:text> document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true);
-</xsl:text>
- <xsl:text> this.opened = false;
-</xsl:text>
<xsl:text> },
</xsl:text>
<xsl:text> set_complete_text: function(){
--- a/svghmi/widget_dropdown.ysl2 Tue Apr 14 17:31:45 2020 +0200
+++ b/svghmi/widget_dropdown.ysl2 Tue Apr 14 19:22:18 2020 +0200
@@ -84,12 +84,12 @@
e.stopPropagation();
},
close: function(){
+ document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true);
this.reset_text();
this.reset_box();
this.element.appendChild(this.button_elt);
+ this.opened = false;
this.apply_cache();
- document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true);
- this.opened = false;
},
set_complete_text: function(){
let spans = this.text_elt.children;