From 94414f36bc1cdfcc987981a23a297e2b98fd9631 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 16 Oct 2021 21:12:11 +0200 Subject: [PATCH] [!] add parenthesis surrounding the if condition to clearly separate it from the rest of the string composition. if didn't do that the right part of the "else" will be added with end of the string, which is not the intention. --- web/widgets/left_menu_html.anubis | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/widgets/left_menu_html.anubis b/web/widgets/left_menu_html.anubis index 4ee1d5f..dee6a9e 100644 --- a/web/widgets/left_menu_html.anubis +++ b/web/widgets/left_menu_html.anubis @@ -30,15 +30,14 @@ define List(HTML_Off_Form) with item_class = if subentry then "subitem " else "item ", if _target_id is { - failure then p([class(item_class+_menu_id+"_icon"+if _menu_id=selected then " selected" else ""+ " "+join(" ", _classes))],actioner(same,same, link(_T(_text)),_action,_extra)), + failure then p([class(item_class+_menu_id+"_icon"+(if _menu_id=selected then " selected" else "")+ " "+join(" ", _classes))],actioner(same,same, link(_T(_text)),_action,_extra)), success(target_id) then - p([class(item_class+"clickable "+_menu_id+"_icon"+if _menu_id=selected then " selected" else ""+ " "+join(" ", _classes)), -// event(onclick, "Xlib.load_content('"+target_id+"', "+format_web_action_name_to_js(_action, _extra)+")")],text(_T(_text))), + p([class(item_class+"clickable "+_menu_id+"_icon"+(if _menu_id=selected then " selected" else "")+ " "+join(" ", _classes)), event(onclick, load_content(target_id, _action, _extra))],text(_T(_text))), } title(_title_id, subtitle, _classes, _text) then - p([class(if subtitle then "menu_subtitle" else "menu_title"), class(if _title_id=selected then " selected" else ""+ " "+join(" ", _classes))], text([],_T(_text))) + p([class(if subtitle then "menu_subtitle" else "menu_title"), class((if _title_id=selected then " selected" else "")+ " "+join(" ", _classes))], text([],_T(_text))) // p([class("menu_title"), class("item "+_title_id+"_icon"+if _title_id=selected then " selected" else ""+ " "+join(" ", _classes))], text([],_T(_text))) }, make_left_menu(_T, t, selected, [ entry . so_far]) -- libgit2 0.21.4