From 8e2cef5f07cc0f6ae135fdaf554c86cc3c4979fe Mon Sep 17 00:00:00 2001 From: reger Date: Thu, 15 Dec 2016 00:45:08 +0100 Subject: [PATCH] allow protocol navigator to be unselected if only one button is shown after activating navi/facetfilter --- htroot/yacysearchtrailer.html | 2 +- htroot/yacysearchtrailer.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htroot/yacysearchtrailer.html b/htroot/yacysearchtrailer.html index 44f8dd92b..01fb25499 100644 --- a/htroot/yacysearchtrailer.html +++ b/htroot/yacysearchtrailer.html @@ -71,7 +71,7 @@
#{element}# -
+
#{/element}#
#(/nav-protocols)# diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java index 6de89755d..853989157 100644 --- a/htroot/yacysearchtrailer.java +++ b/htroot/yacysearchtrailer.java @@ -256,22 +256,25 @@ public class yacysearchtrailer { if (oldProtocolModifier == null || !oldProtocolModifier.equals(name)) { pos++; prop.put("nav-protocols_element_" + i + "_on", 0); + prop.put("nav-protocols_element_" + i + "_onclick", 0); prop.put(fileType, "nav-protocols_element_" + i + "_modifier", nav); } else { neg++; prop.put("nav-protocols_element_" + i + "_on", 1); + prop.put("nav-protocols_element_" + i + "_onclick", 1); prop.put(fileType, "nav-protocols_element_" + i + "_modifier", "-" + nav); nav=""; rawNav = ""; } prop.put(fileType, "nav-protocols_element_" + i + "_name", name); String url = QueryParams.navurl(fileType, 0, theSearch.query, rawNav, false).toString(); - prop.put("nav-protocols_element_" + i + "_on_url", url); + prop.put("nav-protocols_element_" + i + "_onclick_url", url); prop.put(fileType, "nav-protocols_element_" + i + "_url", url); prop.put("nav-protocols_element_" + i + "_count", count); prop.put("nav-protocols_element_" + i + "_nl", 1); i++; } + if (i == 1) prop.put("nav-protocols_element_0_onclick", 0); // allow to unselect, if only one button theSearch.query.modifier.protocol = oldProtocolModifier; if (oldProtocolModifier != null && oldProtocolModifier.length() > 0) theSearch.query.modifier.add(oldProtocolModifier.startsWith("/") ? oldProtocolModifier : "/" + oldProtocolModifier); theSearch.query.getQueryGoal().query_original = oldQuery;