From 0c3ad58966efe265690505c5a00a3900e66f0483 Mon Sep 17 00:00:00 2001 From: hppeng-wynn <77039964+hppeng-wynn@users.noreply.github.com> Date: Sun, 14 Aug 2022 20:39:43 -0700 Subject: [PATCH] Fix advanced searcher functionality (#205) * Fix advanced searcher functionality some visual tuneup may be in order * Refactor `items_2` to `items_adv` Co-authored-by: hppeng --- css/{items_2.css => items_adv.css} | 0 items_adv/index.html | 7 ++++--- .../{items_2_help.html => items_adv_help.html} | 0 js/{items_2.js => items_adv.js} | 13 ++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) rename css/{items_2.css => items_adv.css} (100%) rename items_adv/{items_2_help.html => items_adv_help.html} (100%) rename js/{items_2.js => items_adv.js} (97%) diff --git a/css/items_2.css b/css/items_adv.css similarity index 100% rename from css/items_2.css rename to css/items_adv.css diff --git a/items_adv/index.html b/items_adv/index.html index 3d21a58..120e6ab 100644 --- a/items_adv/index.html +++ b/items_adv/index.html @@ -16,7 +16,7 @@ - + @@ -39,7 +39,7 @@ Additional credits
- Search Guide + Search Guide
Basic Item Search @@ -77,12 +77,13 @@ + - + diff --git a/items_adv/items_2_help.html b/items_adv/items_adv_help.html similarity index 100% rename from items_adv/items_2_help.html rename to items_adv/items_adv_help.html diff --git a/js/items_2.js b/js/items_adv.js similarity index 97% rename from js/items_2.js rename to js/items_adv.js index 220b447..7579228 100644 --- a/js/items_2.js +++ b/js/items_adv.js @@ -234,7 +234,7 @@ function stringify(v) { return typeof v === 'number' ? (Math.round(v * 100) / 100).toString() : v; } -function init_items2() { +function init_items_adv() { const itemList = document.getElementById('item-list'); const itemListFooter = document.getElementById('item-list-footer'); @@ -328,7 +328,11 @@ function init_items2() { for (let i = 0; i < searchMax; i++) { const result = searchResults[i]; itemEntries[i].classList.add('visible'); - displaysq2ExpandedItem(result.itemExp, `item-entry-${i}`); + result.itemExp.set("powders", []); + if (result.itemExp.get("category") == "weapon") { + apply_weapon_powders(result.itemExp); + } + displayExpandedItem(result.itemExp, `item-entry-${i}`); if (result.sortKeys.length > 0) { const sortKeyListContainer = document.createElement('div'); sortKeyListContainer.classList.add('row'); @@ -391,4 +395,7 @@ function init_items2() { .addEventListener('mousedown', e => scrollTo({ top: 0, behavior: 'smooth' })); } -load_init(init_items2); +(async function() { + await Promise.resolve(load_init()); + init_items_adv(); +})();