svghmi/widget_back.ysl2
branchsvghmi
changeset 2902 1fcb50af0335
parent 2901 3f5194bba67d
child 2912 d320367eb2ad
equal deleted inserted replaced
2901:3f5194bba67d 2902:1fcb50af0335
       
     1 // widget_back.ysl2
       
     2 
       
     3 template "widget[@type='Back']", mode="widget_defs" {
       
     4     param "hmi_element";
       
     5 
       
     6     |     on_click: function(evt) {
       
     7     |         console.log("Back !");
       
     8     |         if(jump_history.length > 1){
       
     9     |            jump_history.pop();
       
    10     |            let [page_name, index] = jump_history.pop();
       
    11     |            switch_page(page_name, index);
       
    12     |         }
       
    13     |     },
       
    14     |     init: function() {
       
    15     |         this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)");
       
    16     |     },
       
    17 }
       
    18