diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-27 19:15:48 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-27 19:17:49 +0200 |
commit | 0040058da671bdb103dbd4c402290f5f8f51080b (patch) | |
tree | c5d21721e24a6a020310d3f538863ca71c09cc8b /tpl/default/js | |
parent | b320c860f5c794c57c08ee2a65c9b73768aac23c (diff) | |
download | Shaarli-0040058da671bdb103dbd4c402290f5f8f51080b.tar.gz Shaarli-0040058da671bdb103dbd4c402290f5f8f51080b.tar.zst Shaarli-0040058da671bdb103dbd4c402290f5f8f51080b.zip |
Theme: JS - Fix a bug preventing edit margin suppression to work
Explanation: an ID with a leading digit isn't a valid CSS selector
Diffstat (limited to 'tpl/default/js')
-rw-r--r-- | tpl/default/js/shaarli.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js index 30d8ed6f..edcf2809 100644 --- a/tpl/default/js/shaarli.js +++ b/tpl/default/js/shaarli.js | |||
@@ -255,10 +255,9 @@ window.onload = function () { | |||
255 | * Remove CSS target padding (for fixed bar) | 255 | * Remove CSS target padding (for fixed bar) |
256 | */ | 256 | */ |
257 | if (location.hash != '') { | 257 | if (location.hash != '') { |
258 | var anchor = document.querySelector(location.hash); | 258 | var anchor = document.getElementById(location.hash.substr(1)); |
259 | if (anchor != null) { | 259 | if (anchor != null) { |
260 | var padsize = anchor.clientHeight; | 260 | var padsize = anchor.clientHeight; |
261 | console.log(document.querySelector(location.hash).clientHeight); | ||
262 | this.window.scroll(0, this.window.scrollY - padsize); | 261 | this.window.scroll(0, this.window.scrollY - padsize); |
263 | anchor.style.paddingTop = 0; | 262 | anchor.style.paddingTop = 0; |
264 | } | 263 | } |