From 8457066f56eb80b715073d1697bcf1a06b92e724 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Tue, 14 Jun 2016 20:35:48 +0100 Subject: [PATCH] Scroll to target plugin after conflict filtering This helps users identify the plugin in the list and quickly see what other plugins are around it. --- src/gui/html/js/events.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/html/js/events.js b/src/gui/html/js/events.js index 13e01d6e..f3ba0933 100644 --- a/src/gui/html/js/events.js +++ b/src/gui/html/js/events.js @@ -422,6 +422,12 @@ function onConflictsFilter(evt) { } }); loot.filters.apply(loot.game.plugins); + + /* Scroll to the target plugin */ + const list = document.getElementById('pluginCardList'); + const index = list.items.findIndex(item => item.name === evt.target.value); + list.scrollToIndex(index); + loot.Dialog.closeProgress(); }).catch(loot.handlePromiseError); } else {