diff -r 2adfce8908b4 -r 15bebe9a2806 svghmi/widget_jump.ysl2 --- a/svghmi/widget_jump.ysl2 Sun May 10 16:36:09 2020 +0200 +++ b/svghmi/widget_jump.ysl2 Sun May 10 16:36:41 2020 +0200 @@ -81,33 +81,19 @@ | this.active_elt_style = this.active_elt.getAttribute("style"); | this.inactive_elt_style = this.inactive_elt.getAttribute("style"); } - if "$have_disability" { + choose { + when "$have_disability" { | this.disabled_elt_style = this.disabled_elt.getAttribute("style"); + } + otherwise { + | this.sub = function(){}; + | this.unsub = function(){}; + | this.apply_cache = function(){}; + } } | }, } -// default : normal subscribing -template "widget[@type='Jump']", mode="widget_subscribe" { - param "hmi_element"; - const "activity" call "jump_widget_activity" with "hmi_element", "$hmi_element"; - const "have_activity","string-length($activity)>0"; - const "disability" call "jump_widget_disability" with "hmi_element", "$hmi_element"; - const "have_disability","$have_activity and string-length($disability)>0"; - choose { - when "$have_disability" { - | sub: subscribe, - | unsub: unsubscribe, - | apply_cache: widget_apply_cache, - } - otherwise { - | sub: function(){}, - | unsub: function(){}, - | apply_cache: function(){}, - } - } -} - template "widget[@type='Jump']", mode="per_page_widget_template"{ param "page_desc"; /* check that given path is compatible with page's reference path */