master #116

Merged
mpeltriaux merged 13 commits from master into 110_Biotope_codelists 2022-02-16 08:50:41 +01:00
Showing only changes of commit 1ea5b4fc39 - Show all commits

View File

@ -1,3 +1,9 @@
{% load i18n %}
<div class="ml-4 mb-4">
<input id="tree-search-input" class="form-control" type="text" placeholder="{% trans 'Search' %}"/>
</div>
<div id="tree-root"> <div id="tree-root">
{% include 'konova/widgets/checkbox-tree-select-content.html' %} {% include 'konova/widgets/checkbox-tree-select-content.html' %}
</div> </div>
@ -31,6 +37,22 @@
toggleSelectedCssClass(this); toggleSelectedCssClass(this);
} }
function searchInputHandler(event){
var elem = $(this);
var val = elem.val()
var allTreeElements = $(".tree-element")
var allTreeElementsContain = $(".tree-element:contains(" + val + ")")
if(val.length > 0){
allTreeElements.hide()
allTreeElementsContain.show()
}else{
allTreeElements.show()
}
}
// Add event listener on search input
$("#tree-search-input").keyup(searchInputHandler)
// Add event listener on changed checkboxes // Add event listener on changed checkboxes
$(".tree-input").change(changeHandler); $(".tree-input").change(changeHandler);