aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-15 00:47:27 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-15 00:47:27 +0200
commita925dd38ad8a51dbf443506b0772150a5cef0799 (patch)
treee7c3250e0aff34c5cab90b454b8d95765fc6c795
parentHTML Generated events now come without an UID. (diff)
downloadcalp-a925dd38ad8a51dbf443506b0772150a5cef0799.tar.gz
calp-a925dd38ad8a51dbf443506b0772150a5cef0799.tar.xz
Repair jump to date.
-rw-r--r--module/output/html.scm2
-rw-r--r--static/script.js6
-rw-r--r--static/style.css6
3 files changed, 7 insertions, 7 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index acc93c0e..2d113b35 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -737,7 +737,7 @@
[else ""]))
"idag"))
- (div (@ (class "jump-to"))
+ (div (@ (id "jump-to"))
;; Firefox's accessability complain about each date
;; component, meaning that it's broken. This label
;; is for the whole input, which can be enabled
diff --git a/static/script.js b/static/script.js
index 6870819b..822b60c2 100644
--- a/static/script.js
+++ b/static/script.js
@@ -493,8 +493,7 @@ window.onload = function () {
form updates.
*/
- let jumpto = document.getElementsByClassName("jump-to")[0];
- let gotodatebtn = jumpto.getElementsByTagName("button")[0];
+ let gotodatebtn = document.querySelector("#jump-to .btn");
let target_href = (new Date).format("%Y-%m-%d") + ".html";
let golink = makeElement('a', {
className: 'btn',
@@ -504,8 +503,9 @@ window.onload = function () {
document.getElementById("today-button").href = target_href;
gotodatebtn.replaceWith(golink);
- jumpto.getElementsByTagName("input")[0].onchange = function () {
+ document.querySelector("#jump-to input[name='date']").onchange = function () {
let date = this.valueAsDate.format("%Y-%m-%d");
+ console.log(date);
golink.href = date + ".html";
}
diff --git a/static/style.css b/static/style.css
index abb4f8c7..a413ce83 100644
--- a/static/style.css
+++ b/static/style.css
@@ -108,16 +108,16 @@ html, body {
padding-bottom: 1ex;
}
-.jump-to > form {
+#jump-to > form {
display: flex;
}
-.jump-to input {
+#jump-to input {
flex-grow: 2;
margin-right: 1em;
}
-.jump-to button, .jump-to a {
+#jump-to button, #jump-to a {
/* Same as height, figure out way to force this */
width: 2.5em;
}