svghmi/widget_foreach.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 13 May 2020 18:47:09 +0200
branchsvghmi
changeset 2960 5ad82541b46e
parent 2959 ae549ba1a116
child 3003 9771a724af09
permissions -rw-r--r--
SVGHMI: explicit handling of undefined maximum widget update frequency
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
template "widget[@type='ForEach']", mode="widget_defs" {
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
    param "hmi_element";
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     4
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     5
    const "class","arg[1]/@value";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     6
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     7
    const "base_path","path/@value";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     8
    const "hmi_index_base", "$indexed_hmitree/*[@hmipath = $base_path]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
     9
    const "hmi_tree_base", "$hmitree/descendant-or-self::*[@path = $hmi_index_base/@path]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    10
    const "hmi_tree_items", "$hmi_tree_base/*[@class = $class]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    11
    const "hmi_index_items", "$indexed_hmitree/*[@path = $hmi_tree_items/@path]"; 
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    12
    const "items_paths", "$hmi_index_items/@hmipath"; 
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    13
    |     index_pool: [
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    14
    foreach "$hmi_index_items" {
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    15
    |       «@index»`if "position()!=last()" > ,`
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    16
    }
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    17
    |     ],
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    18
    |     init: function() {
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    19
    const "prefix","concat($class,':')";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    20
    const "buttons_regex","concat('^',$prefix,'[+\-][0-9]+')";
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    21
    const "buttons", "$hmi_element/*[regexp:test(@inkscape:label, $buttons_regex)]"; 
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    22
    foreach "$buttons" {
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    23
        const "op","substring-after(@inkscape:label, $prefix)";
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    24
    |         id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click('«$op»', evt)");
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    25
    }
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    26
    |
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    27
    |         this.items = [
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    28
    const "items_regex","concat('^',$prefix,'[0-9]+')";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    29
    const "unordered_items","$hmi_element//*[regexp:test(@inkscape:label, $items_regex)]";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    30
    foreach "$unordered_items" {
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    31
        const "elt_label","concat($prefix, string(position()))"; 
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    32
        const "elt","$unordered_items[@inkscape:label = $elt_label]";
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    33
        const "pos","position()";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    34
        const "item_path", "$items_paths[$pos]";
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    35
    |           [ /* item="«$elt_label»" path="«$item_path»" */
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    36
        if "count($elt)=0" error > Missing item labeled «$elt_label» in ForEach widget «$hmi_element/@id»
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    37
        foreach "func:refered_elements($elt)[@id = $hmi_elements/@id][not(@id = $elt/@id)]" {
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    38
            if "not(func:is_descendant_path(func:widget(@id)/path/@value, $item_path))"
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    39
                error > Widget id="«@id»" label="«@inkscape:label»" is having wrong path. Accroding to ForEach widget ancestor id="«$hmi_element/@id»", path should be descendant of "«$item_path»".
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    40
    |             hmi_widgets["«@id»"]`if "position()!=last()" > ,`
2892
27dd409fba1d SVGHMI: ForEach knows its own widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2891
diff changeset
    41
        }
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    42
    |           ]`if "position()!=last()" > ,`
2892
27dd409fba1d SVGHMI: ForEach knows its own widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2891
diff changeset
    43
    }
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    44
    |         ]
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    45
    |     },
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    46
    |     item_offset: 0,
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    47
}
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    48
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    49
template "widget[@type='ForEach']", mode="widget_class"
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    50
||
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    51
class ForEachWidget extends Widget{
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    52
    unsub(){
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    53
        for(let item of this.items){
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    54
            for(let widget of item) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    55
                widget.unsub();
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    56
            }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    57
        }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    58
        this.offset = 0;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    59
    }
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    60
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    61
    foreach_widgets_do(new_offset, todo){
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    62
        this.offset = new_offset;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    63
        for(let i = 0; i < this.items.length; i++) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    64
            let item = this.items[i];
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    65
            let orig_item_index = this.index_pool[i];
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    66
            let item_index = this.index_pool[i+this.item_offset];
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    67
            let item_index_offset = item_index - orig_item_index;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    68
            for(let widget of item) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    69
                todo(widget).call(widget, new_offset + item_index_offset);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    70
            }
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
    71
        }
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
    72
    }
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
    73
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    74
    sub(new_offset=0){
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    75
        this.foreach_widgets_do(new_offset, w=>w.sub);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    76
    }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    77
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    78
    apply_cache() {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    79
        this.foreach_widgets_do(this.offset, w=>w.apply_cache);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    80
    }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    81
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    82
    on_click(opstr, evt) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    83
        let new_item_offset = eval(String(this.item_offset)+opstr);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    84
        if(new_item_offset + this.items.length > this.index_pool.length) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    85
            if(this.item_offset + this.items.length == this.index_pool.length)
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    86
                new_item_offset = 0;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    87
            else
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    88
                new_item_offset = this.index_pool.length - this.items.length;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    89
        } else if(new_item_offset < 0) {
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    90
            if(this.item_offset == 0)
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    91
                new_item_offset = this.index_pool.length - this.items.length;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    92
            else
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    93
                new_item_offset = 0;
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
    94
        }
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    95
        this.item_offset = new_item_offset;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    96
        this.unsub();
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    97
        this.sub(this.offset);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    98
        update_subscriptions();
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    99
        need_cache_apply.push(this);
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   100
        jumps_need_update = true;
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   101
        requestHMIAnimation();
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   102
    }
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   103
}
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   104
||
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   105