Skip to content

Commit

Permalink
feat(web): add select all/none for columns & black theme (#2878)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambia committed Dec 15, 2021
1 parent d6d8ef2 commit 2ff7f58
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions web/index.html
Expand Up @@ -2,6 +2,21 @@
<html>
<head>
<title>streetmerchant control</title>
<style>
body {
background-color: #222;
color: #DDD;
font-family: sans-serif;
}
a {
color: aquamarine;
}
table th {
width: 25vw;
cursor: pointer;
background-color: #444;
}
</style>
<script type="text/javascript">
let config;
let brands;
Expand Down Expand Up @@ -135,15 +150,26 @@

await loadScreenshots();
}

function selectAll(element, columnId) {
const list = document.querySelectorAll("#"+columnId+" input");
const checked = [...list].filter( el => el.checked ).length;
const newValue = (checked==list.length) ? false : true;

for (const htmlElement of list) {
htmlElement.checked = newValue;
}
}

</script>
</head>
<body onload="loadInitial();">
<table>
<tr>
<th>Stores</th>
<th>Brands</th>
<th>Series</th>
<th>Models</th>
<th onclick="selectAll(this, 'storeList');">Stores</th>
<th onclick="selectAll(this, 'brandList');">Brands</th>
<th onclick="selectAll(this, 'seriesList');">Series</th>
<th onclick="selectAll(this, 'modelList');">Models</th>
</tr>
<tr>
<td valign="top" id="storeList"></td>
Expand Down

0 comments on commit 2ff7f58

Please sign in to comment.