Clear Selection button
parent
7421e82b82
commit
a57280088b
|
@ -1,6 +1,6 @@
|
|||
var cacheEnabled = true;
|
||||
|
||||
var updateCache = function() {
|
||||
var persistCache = function() {
|
||||
if (cacheEnabled) {
|
||||
window.localStorage.setItem('cache', cache);
|
||||
}
|
||||
|
@ -55,10 +55,17 @@ function toggleRow(e) {
|
|||
} else {
|
||||
setRowValue(id, true);
|
||||
}
|
||||
updateCache();
|
||||
persistCache();
|
||||
}
|
||||
|
||||
function updateHideUnselected() {
|
||||
var table = document.getElementById('the_table');
|
||||
table.className == "hide-unselected" ? table.className = "" : table.className = "hide-unselected";
|
||||
}
|
||||
|
||||
function clearSelection() {
|
||||
for (var i=1; i<=cache.length; i++) {
|
||||
setRowValue(i, false);
|
||||
}
|
||||
persistCache();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
<label for="showToggle">Hide unselected</label>
|
||||
<input type="checkbox" id="showToggle" onchange="updateHideUnselected()">
|
||||
|
||||
<button id="clearSelection" onclick="clearSelection()">Clear Selection</button>
|
||||
|
||||
<table id="the_table">
|
||||
<tr>
|
||||
<th scope="col">Time & Estimate</th>
|
||||
|
|
Loading…
Reference in New Issue