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