From bc8533f5e9e211f250b5bc3247797feac0f1303b Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Mon, 18 Dec 2017 15:06:11 -0500 Subject: Bug 905763 - Fix named anchors in various pages so that the Sandstone theme header can be set to a fixed position --- js/comments.js | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'js/comments.js') diff --git a/js/comments.js b/js/comments.js index 88ba49364..82c93e561 100644 --- a/js/comments.js +++ b/js/comments.js @@ -178,23 +178,3 @@ function getText(element) { } return text; } - -/** - * If the URL contains a comment ID like #c10, scroll down the page to show the - * entire comment below the fixed global header. - */ -function scroll_comment_into_view() { - if (location.hash.match(/^#c\d+$/)) { - var $header = document.querySelector('#header'); - var $comment = document.querySelector(location.hash); - - if ($comment) { - window.setTimeout(function() { - window.scrollTo(0, $comment.offsetTop - $header.offsetHeight - 20); - }, 100); - } - } -} - -window.addEventListener('load', scroll_comment_into_view, { once: true }); -window.addEventListener('hashchange', scroll_comment_into_view); -- cgit v1.2.3-24-g4f1b