diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2023-05-07 22:16:38 +0100 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-05-07 22:16:38 +0100 | 
| commit | cb07e37ed72182af33a992d7e0b44f7c7ee4af04 (patch) | |
| tree | 6576f0cdf1b0a1256b3fcdb94873545e2068699f /static | |
| parent | 1eea185d337eadd7a5309a707d8f0c5cd0d85d9c (diff) | |
| download | UKGenderPayGap-cb07e37ed72182af33a992d7e0b44f7c7ee4af04.tar.gz UKGenderPayGap-cb07e37ed72182af33a992d7e0b44f7c7ee4af04.zip  | |
Finished filtering client side
Diffstat (limited to 'static')
| -rw-r--r-- | static/scripts.js | 12 | ||||
| -rw-r--r-- | static/style.css | 18 | 
2 files changed, 18 insertions, 12 deletions
diff --git a/static/scripts.js b/static/scripts.js index 6fec221..01196d3 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -1,5 +1,11 @@ -function collapseTogglePress(elem) { -    console.log("elem"); +function collapseTogglePress(elem, a_elem, num_hidden) { +    if (getComputedStyle(document.getElementById(elem)).display === "none") { +        document.getElementById(elem).style.display = "block"; +        document.getElementById(a_elem).innerText = `Hide ${num_hidden} filters` +    } else { +        document.getElementById(elem).style.display = "none"; +        document.getElementById(a_elem).innerText =`Un-hide ${num_hidden} hidden filters` +    }  }  const PLOT_FUNC_MAPPINGS = { @@ -7,7 +13,7 @@ const PLOT_FUNC_MAPPINGS = {  }  $(document).ready(function() { -    console.log("ready!"); +    document.getElementById("filterform").action = window.location.pathname + "/apply_click";      fetch("/api/charts.json").then((resp) => {          resp.json().then((body) => { diff --git a/static/style.css b/static/style.css index 28d53c7..660a3b4 100644 --- a/static/style.css +++ b/static/style.css @@ -40,6 +40,13 @@ input[type="search"] {    width: 100%;  } +input[type="submit"] { +  padding: 3px 5px; +  box-sizing: border-box; +  border: 2px solid black; +  width: 100%; +} +  aside form input[type="submit"] {    margin-top: 3px;    width: 100%; @@ -63,15 +70,8 @@ label {  }  .collapsetoggle { -  color: black; -  font-weight: bold; -  padding-top: 1px; -  text-decoration: none; -} - -.collapsetoggle#hover { -  cursor: pointer; -  text-decoration: underline; +  font-size: x-small; +  padding-left: 5px;  }  #main_content {  | 
