From 20f2cad25ce1c4843f4568131d83236ca9bf9a39 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 13 May 2016 06:51:45 +0100 Subject: [PATCH] Fix LOOT scrolling to first plugin card on init Some of this fix is in iron-list's merged fix-resize-external-scroll-target branch. LOOT's JS code changes prevent changing game from not updating the plugin cards after changing game until the window is resized. --- src/gui/html/js/events.js | 4 ---- src/gui/html/js/helpers.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/html/js/events.js b/src/gui/html/js/events.js index 7684b933..2f4441d6 100644 --- a/src/gui/html/js/events.js +++ b/src/gui/html/js/events.js @@ -41,10 +41,6 @@ function onChangeGame(evt) { const gameInfo = JSON.parse(result, loot.Plugin.fromJson); loot.game = new loot.Game(gameInfo, loot.l10n); - /* Reset virtual list positions. */ - document.getElementById('cardsNav').scrollToIndex(0); - document.getElementById('pluginCardList').scrollToIndex(0); - /* Now update virtual lists. */ filterPluginData(loot.game.plugins, loot.filters); diff --git a/src/gui/html/js/helpers.js b/src/gui/html/js/helpers.js index c32995d0..b5bf1e07 100644 --- a/src/gui/html/js/helpers.js +++ b/src/gui/html/js/helpers.js @@ -54,6 +54,7 @@ function filterPluginData(plugins, filters) { } } document.getElementById('cardsNav').notifyResize(); + document.getElementById('pluginCardList').notifyResize(); /* Now perform search again. If there is no current search, this won't do anything. */