Add show all IsA option

This commit is contained in:
Edward Betts 2021-05-08 10:45:14 +02:00
parent 7ed3b849e0
commit 50b92760df
2 changed files with 13 additions and 0 deletions

View file

@ -168,6 +168,16 @@ function isa_only(e) {
checkbox_change();
}
function show_all_isa(e) {
e.preventDefault();
var checkbox_list = document.getElementsByClassName('isa-checkbox');
for (const checkbox of checkbox_list) {
checkbox.checked = true;
}
checkbox_change();
}
function checkbox_change() {
var checkbox_list = document.getElementsByClassName('isa-checkbox');
var ticked = [];
@ -350,6 +360,8 @@ function load_wikidata_items() {
};
document.getElementById('show-all-isa').onclick = show_all_isa;
var load_btn = document.getElementById('load-btn');
load_btn.onclick = load_wikidata_items;

View file

@ -29,6 +29,7 @@
<div class="card bg-white visually-hidden mt-3" id="isa-card">
<div class="card-body">
<div class="h5 card-title">item types</div>
<div><a href="#" id="show-all-isa">show all</a></div>
<div id="isa-list">
</div>
</div>