]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Theme: JS - Fix a bug preventing edit margin suppression to work 837/head
authorArthurHoaro <arthur@hoa.ro>
Mon, 27 Mar 2017 17:15:48 +0000 (19:15 +0200)
committerArthurHoaro <arthur@hoa.ro>
Mon, 27 Mar 2017 17:17:49 +0000 (19:17 +0200)
Explanation: an ID with a leading digit isn't a valid CSS selector

tpl/default/js/shaarli.js

index 30d8ed6ff73482f9502e03268e321c3643aa0726..edcf280944a6f723551bf5df011f9228f71588f5 100644 (file)
@@ -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;
         }