Commit 28a02297 authored by Eric Duminil's avatar Eric Duminil
Browse files

Select All or None.

parent 51841bfb
......@@ -25,7 +25,7 @@
<div id="header">
<ul>
<li class="title">Simstadt Region Chooser</li>
<li class="title" id="repository"><button onclick="regionChooser.selectRepository()">Select repository</button></li>
<li class="title" id="select_repository" style="visibility:hidden"><button onclick="regionChooser.selectRepository()">Select repository</button></li>
</ul>
</div>
<div id="map" class="map" tabindex="0"></div>
......
......@@ -10,6 +10,7 @@ var regionChooser = (function(){
//NOTE: Only called from JavaFX. At startup, or when Repo has been changed.
gmlId = 0;
kml_source.clear();
document.getElementById("select_repository").style.visibility = "visible";
}
if (fromJavaFX){
......@@ -290,10 +291,10 @@ var regionChooser = (function(){
dataPanel.append(wgs84_coords + "<br/>\n");
}
dataPanel.append("<h3 class='clean'>Area : " + (area / 10000).toFixed(1) + " ha\n");
//TODO: Add selectAll
//TODO: Add selectNone
//TODO: Hide button if empty
dataPanel.append('<button type="button" onclick="regionChooser.downloadFromSelectedCityGMLs()" id="download" style="visibility:hidden">Download Region</button>');
dataPanel.append('<button type="button" onclick="regionChooser.downloadFromSelectedCityGMLs()" id="download" style="visibility:hidden">Download Region</button><br/>\n');
dataPanel.append('<a href="#" onclick="regionChooser.checkCityGMLS(true);">(Select All)</a>');
dataPanel.append('<a href="#" onclick="regionChooser.checkCityGMLS(false);">(Select None)</a>');
dataPanel.append('<br/>\n');
findIntersections();
}
......@@ -387,6 +388,10 @@ var regionChooser = (function(){
}
}
publicScope.checkCityGMLS = function(allOrNone) {
document.querySelectorAll("input.select_citygml").forEach(c => c.checked = allOrNone);
}
publicScope.selectRepository = function() {
console.log("Should probably do select repository.");
fxapp.selectRepository();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment