diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/script.js | 6 | ||||
-rw-r--r-- | static/style.css | 6 |
2 files changed, 6 insertions, 6 deletions
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; } |