--- a/svghmi/gen_index_xhtml.xslt Wed Jun 03 13:31:55 2020 +0200
+++ b/svghmi/gen_index_xhtml.xslt Thu Jun 04 11:14:21 2020 +0200
@@ -912,6 +912,8 @@
<xsl:text> frequency = 10; /* FIXME arbitrary default max freq. Obtain from config ? */
+ <xsl:text> unsubscribable = false; <xsl:text> constructor(elt_id,args,indexes,members){
<xsl:text> this.element_id = elt_id;
@@ -932,7 +934,7 @@
<xsl:text> /* remove subsribers */
- <xsl:text> for(let index of this.indexes){
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){ <xsl:text> let idx = index + this.offset;
@@ -954,7 +956,7 @@
<xsl:text> /* add this's subsribers */
- <xsl:text> for(let index of this.indexes){
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){ <xsl:text> subscribers[index + new_offset].add(this);
@@ -968,7 +970,7 @@
<xsl:text> apply_cache() {
- <xsl:text> for(let index of this.indexes){
+ <xsl:text> if(!this.unsubscribable) for(let index of this.indexes){ <xsl:text> /* dispatch current cache in newly opened page widgets */
@@ -2292,11 +2294,7 @@
- <xsl:text> this.sub = function(){};
- <xsl:text> this.unsub = function(){};
- <xsl:text> this.apply_cache = function(){};
+ <xsl:text> this.unsubscribable = true; --- a/svghmi/widget_jump.ysl2 Wed Jun 03 13:31:55 2020 +0200
+++ b/svghmi/widget_jump.ysl2 Thu Jun 04 11:14:21 2020 +0200
@@ -86,9 +86,7 @@
| this.disabled_elt_style = this.disabled_elt.getAttribute("style");
- | this.sub = function(){};
- | this.unsub = function(){};
- | this.apply_cache = function(){};
+ | this.unsubscribable = true; --- a/svghmi/widgets_common.ysl2 Wed Jun 03 13:31:55 2020 +0200
+++ b/svghmi/widgets_common.ysl2 Thu Jun 04 11:14:21 2020 +0200
@@ -67,6 +67,7 @@
frequency = 10; /* FIXME arbitrary default max freq. Obtain from config ? */
+ unsubscribable = false; constructor(elt_id,args,indexes,members){
this.element_id = elt_id;
this.element = id(elt_id);
@@ -77,7 +78,7 @@
- for(let index of this.indexes){
+ if(!this.unsubscribable) for(let index of this.indexes){ let idx = index + this.offset;
subscribers[idx].delete(this);
@@ -88,14 +89,14 @@
/* set the offset because relative */
this.offset = new_offset;
/* add this's subsribers */
- for(let index of this.indexes){
+ if(!this.unsubscribable) for(let index of this.indexes){ subscribers[index + new_offset].add(this);
need_cache_apply.push(this);
- for(let index of this.indexes){
+ if(!this.unsubscribable) for(let index of this.indexes){ /* dispatch current cache in newly opened page widgets */
let realindex = index+this.offset;
let cached_val = cache[realindex];