svghmi/widget_jump.ysl2
branchsvghmi
changeset 2953 15bebe9a2806
parent 2943 304e88bae115
child 2980 2a21d6060d64
equal deleted inserted replaced
2952:2adfce8908b4 2953:15bebe9a2806
    79     |         this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)");
    79     |         this.element.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click(evt)");
    80     if "$have_activity" {
    80     if "$have_activity" {
    81     |         this.active_elt_style = this.active_elt.getAttribute("style");
    81     |         this.active_elt_style = this.active_elt.getAttribute("style");
    82     |         this.inactive_elt_style = this.inactive_elt.getAttribute("style");
    82     |         this.inactive_elt_style = this.inactive_elt.getAttribute("style");
    83     }
    83     }
    84     if "$have_disability" {
    84     choose {
       
    85         when "$have_disability" {
    85     |         this.disabled_elt_style = this.disabled_elt.getAttribute("style");
    86     |         this.disabled_elt_style = this.disabled_elt.getAttribute("style");
       
    87         }
       
    88         otherwise {
       
    89     |         this.sub = function(){};
       
    90     |         this.unsub = function(){};
       
    91     |         this.apply_cache = function(){};
       
    92         }
    86     }
    93     }
    87     |     },
    94     |     },
    88 }
       
    89 
       
    90 // default : normal subscribing
       
    91 template "widget[@type='Jump']", mode="widget_subscribe" {
       
    92     param "hmi_element";
       
    93     const "activity" call "jump_widget_activity" with "hmi_element", "$hmi_element";
       
    94     const "have_activity","string-length($activity)>0";
       
    95     const "disability" call "jump_widget_disability" with "hmi_element", "$hmi_element";
       
    96     const "have_disability","$have_activity and string-length($disability)>0";
       
    97     choose {
       
    98         when "$have_disability" {
       
    99     |     sub: subscribe,
       
   100     |     unsub: unsubscribe,
       
   101     |     apply_cache: widget_apply_cache,
       
   102         }
       
   103         otherwise {
       
   104     |     sub: function(){},
       
   105     |     unsub: function(){},
       
   106     |     apply_cache: function(){},
       
   107         }
       
   108     }
       
   109 }
    95 }
   110 
    96 
   111 template "widget[@type='Jump']", mode="per_page_widget_template"{
    97 template "widget[@type='Jump']", mode="per_page_widget_template"{
   112     param "page_desc";
    98     param "page_desc";
   113     /* check that given path is compatible with page's reference path */
    99     /* check that given path is compatible with page's reference path */