From 0e6e15e8e5af8b2d3e234daa1b1af9105925adb1 Mon Sep 17 00:00:00 2001 From: jcass Date: Sun, 22 Jan 2017 10:15:38 +0200 Subject: [PATCH] Fix scroll position for the 'browse' pane. --- mopidy_musicbox_webclient/static/js/gui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mopidy_musicbox_webclient/static/js/gui.js b/mopidy_musicbox_webclient/static/js/gui.js index 1912680..3917438 100644 --- a/mopidy_musicbox_webclient/static/js/gui.js +++ b/mopidy_musicbox_webclient/static/js/gui.js @@ -378,7 +378,9 @@ function locationHashChanged () { $('.pane').hide() // Hide all pages $('#' + divid + 'pane').show() // Switch to active pane - if (typeof pageScrollPos[divid] !== 'undefined') { // Set scroll position + if (divid === 'browse' && browseStack.length > 0) { + window.scrollTo(0, browseStack[browseStack.length - 1].scrollPos || 0) // Restore scroll position + } else if (typeof pageScrollPos[divid] !== 'undefined') { // Set scroll position window.scrollTo(0, pageScrollPos[divid]) }