fix removing filter not working

Mon, 05 Aug 2024 19:38:47 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 05 Aug 2024 19:38:47 +0200
changeset 313
7cfe88b8e219
parent 312
b7554a6ef430
child 314
8a8b1c5d168b

fix removing filter not working

fixes #407

src/main/webapp/WEB-INF/jsp/site.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jspf/issue-filter.jspf file | annotate | diff | comparison | revisions
src/main/webapp/issue-overview.js file | annotate | diff | comparison | revisions
--- a/src/main/webapp/WEB-INF/jsp/site.jsp	Mon Aug 05 19:17:36 2024 +0200
+++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Mon Aug 05 19:38:47 2024 +0200
@@ -31,7 +31,7 @@
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
 <%-- Version suffix for forcing browsers to update the CSS / JS files --%>
-<c:set scope="page" var="versionSuffix" value="20240804"/>
+<c:set scope="page" var="versionSuffix" value="20240805"/>
 
 <%-- Make the base href easily available at request scope --%>
 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
--- a/src/main/webapp/WEB-INF/jspf/issue-filter.jspf	Mon Aug 05 19:17:36 2024 +0200
+++ b/src/main/webapp/WEB-INF/jspf/issue-filter.jspf	Mon Aug 05 19:38:47 2024 +0200
@@ -76,7 +76,8 @@
         <%@include file="sort-box.jspf"%>
     </div>
     <div class="medskip">
+        <input type="hidden" id="filter-remove" name="filter">
         <button name="filter" type="submit"><fmt:message key="button.apply"/></button>
-        <a class="button" onclick="document.querySelectorAll('#filter-form *[name=filter]').forEach((elem) => elem.value = ''); document.getElementById('filter-form').submit()"><fmt:message key="button.remove"/></a>
+        <a class="button" onclick="removeAllFilters()"><fmt:message key="button.remove"/></a>
     </div>
 </form>
--- a/src/main/webapp/issue-overview.js	Mon Aug 05 19:17:36 2024 +0200
+++ b/src/main/webapp/issue-overview.js	Mon Aug 05 19:38:47 2024 +0200
@@ -73,11 +73,14 @@
 function toggleAssigneeOnlyMine() {
     const filters = document.getElementById('filter-assignee')
     const toggle = document.getElementById('filter-only-mine')
-    if (toggle.checked) {
-        filters.disabled = true;
-    } else {
-        filters.disabled = false;
-    }
+    filters.disabled = !!toggle.checked;
+}
+
+function removeAllFilters() {
+    document.querySelectorAll('#filter-form *[name=filter]')
+        .forEach((elem) => elem.value = '');
+    document.getElementById('filter-remove').value = 'clear'
+    document.getElementById('filter-form').submit()
 }
 
 function toggleDetails() {

mercurial