added filter to privilege dropdowns
This commit is contained in:
parent
d1ee923f0a
commit
5b861f730f
@ -18,7 +18,7 @@ apply plugin: 'war'
|
|||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
group = 'de.jottyfan.camporganizer'
|
group = 'de.jottyfan.camporganizer'
|
||||||
version = '0.5.0'
|
version = '0.5.1'
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 17
|
||||||
mainClassName = "de.jottyfan.camporganizer.Main"
|
mainClassName = "de.jottyfan.camporganizer.Main"
|
||||||
|
|
||||||
|
@ -5,4 +5,18 @@ class MyToggle {
|
|||||||
toggle(divid) {
|
toggle(divid) {
|
||||||
$("[id='" + divid + "']").toggle();
|
$("[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>
|
<span th:text="${selected}" th:if="${selected}"></span> <span th:unless="${selected}">-- bitte wählen --</span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" th:if="${selected}">
|
<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>
|
<span th:text="${selected}" th:if="${selected}"></span> <span th:unless="${selected}">-- bitte wählen --</span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" th:if="${selected}">
|
<div class="card" th:if="${selected}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user