From: ArthurHoaro Date: Mon, 27 Mar 2017 17:23:54 +0000 (+0200) Subject: Merge pull request #837 from ArthurHoaro/theme/js-edit-linklist-margin X-Git-Tag: v0.9.0~21 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b64d83cd2b60b6851741787f8ce2ae2c93092841;hp=b320c860f5c794c57c08ee2a65c9b73768aac23c;p=github%2Fshaarli%2FShaarli.git Merge pull request #837 from ArthurHoaro/theme/js-edit-linklist-margin Theme: JS - Fix a bug preventing edit margin suppression to work --- 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 () { * Remove CSS target padding (for fixed bar) */ if (location.hash != '') { - var anchor = document.querySelector(location.hash); + var anchor = document.getElementById(location.hash.substr(1)); if (anchor != null) { var padsize = anchor.clientHeight; - console.log(document.querySelector(location.hash).clientHeight); this.window.scroll(0, this.window.scrollY - padsize); anchor.style.paddingTop = 0; }