Mon, 05 Aug 2024 19:38:47 +0200
fix removing filter not working
fixes #407
--- 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() {