From e873b3823f110bfd21a65bdaa0644e823019e761 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 13 Jan 2019 10:57:38 +0100 Subject: Do not scroll back to top when closing a detail popup --- public/static/collapse.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'public/static/collapse.js') diff --git a/public/static/collapse.js b/public/static/collapse.js index 0015c89..373870c 100644 --- a/public/static/collapse.js +++ b/public/static/collapse.js @@ -14,7 +14,12 @@ $(document).ready(function() { if ($(this).hasClass('expanded-moreinfo')) { $(this).removeClass('expanded-moreinfo'); $(this).addClass('collapsed-moreinfo'); + // Setting an empty hash causes the browser to scroll back + // to the top -- we don't want that. + var posX = window.pageXOffset; + var posY = window.pageYOffset; document.location.hash = ''; + window.scrollTo(posX, posY); } else { $('.moreinfo').each(function() { -- cgit v1.2.3