]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tpl/default/js/shaarli.js
Use latest feedbacks
[github/shaarli/Shaarli.git] / tpl / default / js / shaarli.js
index ebe0b5218e91328233462e23b58e95677f08c157..925f6ce717280b7d656202a76c92155e0069a354 100644 (file)
@@ -212,3 +212,13 @@ if (openers != null) {
 function removeClass(element, classname) {
     element.className = element.className.replace(new RegExp('(?:^|\\s)'+ classname + '(?:\\s|$)'), ' ');
 }
+
+/**
+ * Remove CSS target padding (for fixed bar)
+ */
+var anchor = document.querySelector('.anchor:target');
+if (anchor != null) {
+    var padsize = anchor.clientHeight;
+    this.window.scroll(0, this.window.scrollY - padsize);
+    anchor.style.paddingTop = 0;
+}