diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2022-12-31 19:29:47 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2022-12-31 19:29:47 +0100 |
commit | 902369daa6560835b591f22948e6c3cdd255bfe8 (patch) | |
tree | a352df1204c97f7f6dc71ac7a55e545860b8e28f | |
parent | a2080ebf931d8c31da8c6f31770b309e15fdf70e (diff) |
Only act on clicks to the left of the line.
Ignore clicks on the line itself.
-rw-r--r-- | assets/js/lines.js | 3 | ||||
-rw-r--r-- | assets/mumi.scss | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/assets/js/lines.js b/assets/js/lines.js index f22057d..6b11c6f 100644 --- a/assets/js/lines.js +++ b/assets/js/lines.js @@ -1,7 +1,8 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0-or-later window.addEventListener('DOMContentLoaded', function () { let lineClickHandler = (evt) => { - if (evt.target.classList.contains("line")) { + if ((evt.target.classList.contains("line")) && + (evt.x < evt.target.offsetLeft)) { window.location.hash = evt.target.id; return; } diff --git a/assets/mumi.scss b/assets/mumi.scss index 3a96b55..8a3ed12 100644 --- a/assets/mumi.scss +++ b/assets/mumi.scss @@ -344,8 +344,7 @@ div.line:before { visibility: hidden; content: "# "; margin-left: -1em; - padding-right: 1em; - text-align: right; + padding-right: .5em; cursor: pointer; color: $grey-300; } |