added filter to privilege dropdowns
This commit is contained in:
		| @@ -5,4 +5,18 @@ class MyToggle { | ||||
| 	toggle(divid) { | ||||
| 		$("[id='" + divid + "']").toggle(); | ||||
| 	} | ||||
| } | ||||
| } | ||||
|  | ||||
| filterAllOfClass = function(filterselector, haystackselector) { | ||||
|   $(haystackselector).each(function() { | ||||
|     var t = $($(this).children()[0]).text(); | ||||
|     var filter = $(filterselector).val(); | ||||
|     if (filter == '' || filter == '*') { | ||||
| 	    $(this).show(); | ||||
|     } else if (t.toUpperCase().indexOf(filter.toUpperCase()) > -1) { | ||||
| 	    $(this).show(); | ||||
|     } else { | ||||
| 	    $(this).hide(); | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|   | ||||
| @@ -13,7 +13,8 @@ | ||||
| 						<span th:text="${selected}" th:if="${selected}"></span> <span th:unless="${selected}">-- bitte wählen --</span> | ||||
| 					</button> | ||||
| 					<ul class="dropdown-menu"> | ||||
| 						<li th:each="e : ${list}"><a class="dropdown-item" th:href="@{/admin/privileges/campbased/{r}(r=${e.pk})}"><span th:text="${e.fullname}"></span></a></li> | ||||
| 						<li style="padding: 8px"><input type="text" id="needle" onkeyup="filterAllOfClass('#needle', '.haystack')" placeholder="Filter" class="form-control" /></li> | ||||
| 						<li th:each="e : ${list}" class="haystack"><a class="dropdown-item" th:href="@{/admin/privileges/campbased/{r}(r=${e.pk})}" th:text="${e.fullname}"></a></li> | ||||
| 					</ul> | ||||
| 				</div> | ||||
| 				<div class="card" th:if="${selected}"> | ||||
|   | ||||
| @@ -13,7 +13,8 @@ | ||||
| 						<span th:text="${selected}" th:if="${selected}"></span> <span th:unless="${selected}">-- bitte wählen --</span> | ||||
| 					</button> | ||||
| 					<ul class="dropdown-menu"> | ||||
| 						<li th:each="e : ${list}"><a class="dropdown-item" th:href="@{/admin/privileges/userbased/{r}(r=${e.pk})}"><span th:text="${e.fullname}"></span></a></li> | ||||
| 						<li style="padding: 8px"><input type="text" id="needle" onkeyup="filterAllOfClass('#needle', '.haystack')" placeholder="Filter" class="form-control" /></li> | ||||
| 						<li th:each="e : ${list}" class="haystack"><a class="dropdown-item" th:href="@{/admin/privileges/userbased/{r}(r=${e.pk})}" th:text="${e.fullname}"></a></li> | ||||
| 					</ul> | ||||
| 				</div> | ||||
| 				<div class="card" th:if="${selected}"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user