From 50b92760dfac32932c791b99a842a5a1683706b2 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 8 May 2021 10:45:14 +0200 Subject: [PATCH] Add show all IsA option --- static/js/map.js | 12 ++++++++++++ templates/map.html | 1 + 2 files changed, 13 insertions(+) diff --git a/static/js/map.js b/static/js/map.js index 4747cf1..151c31a 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -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; diff --git a/templates/map.html b/templates/map.html index e538b78..805210f 100644 --- a/templates/map.html +++ b/templates/map.html @@ -29,6 +29,7 @@
item types
+
show all