summaryrefslogtreecommitdiff
path: root/public/static/collapse.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-01-13 10:57:38 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-01-13 10:57:38 +0100
commite873b3823f110bfd21a65bdaa0644e823019e761 (patch)
tree13a4280c93e2d0ddbc120b23f000b763f56e647f /public/static/collapse.js
parent70d838bb0825cf5a7fa8dcc2eb4e712001da2c1d (diff)
Do not scroll back to top when closing a detail popup
Diffstat (limited to 'public/static/collapse.js')
-rw-r--r--public/static/collapse.js5
1 files changed, 5 insertions, 0 deletions
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() {