diff options
Diffstat (limited to 'tpl/default/js/shaarli.js')
-rw-r--r-- | tpl/default/js/shaarli.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js index 2e533af6..d8464aa4 100644 --- a/tpl/default/js/shaarli.js +++ b/tpl/default/js/shaarli.js | |||
@@ -216,11 +216,13 @@ window.onload = function () { | |||
216 | /** | 216 | /** |
217 | * Remove CSS target padding (for fixed bar) | 217 | * Remove CSS target padding (for fixed bar) |
218 | */ | 218 | */ |
219 | var anchor = document.querySelector(location.hash); | 219 | if (location.hash != '') { |
220 | if (anchor != null) { | 220 | var anchor = document.querySelector(location.hash); |
221 | var padsize = anchor.clientHeight; | 221 | if (anchor != null) { |
222 | console.log(document.querySelector(location.hash).clientHeight); | 222 | var padsize = anchor.clientHeight; |
223 | this.window.scroll(0, this.window.scrollY - padsize); | 223 | console.log(document.querySelector(location.hash).clientHeight); |
224 | anchor.style.paddingTop = 0; | 224 | this.window.scroll(0, this.window.scrollY - padsize); |
225 | anchor.style.paddingTop = 0; | ||
226 | } | ||
225 | } | 227 | } |
226 | }; | 228 | }; |