From 0040058da671bdb103dbd4c402290f5f8f51080b Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 27 Mar 2017 19:15:48 +0200 Subject: [PATCH] Theme: JS - Fix a bug preventing edit margin suppression to work Explanation: an ID with a leading digit isn't a valid CSS selector --- tpl/default/js/shaarli.js | 3 +-- 1 file changed, 1 insertion(+), 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 () { * 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; } -- 2.41.0