Skip to content

Commit

Permalink
Save search field when the list reloads itself. (explicit user reload…
Browse files Browse the repository at this point in the history
… still clears)
  • Loading branch information
jtsage committed Nov 18, 2022
1 parent 5495659 commit 7df3145
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions renderer/renderJS/assist_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ window.mods.receive('fromMain_modList', (currLocale, modList, extraL10n, current

const lastOpenAcc = document.querySelector('.accordion-collapse.show')
const lastOpenID = (lastOpenAcc !== null) ? lastOpenAcc.id : null
const lastOpenQ = (lastOpenAcc !== null) ? lastOpenAcc.querySelector('input.mod-row-filter').value : ''
const scrollStart = window.scrollY

const selectedList = ( currentList !== '999' && currentList !== '0') ? `collection--${currentList}` : currentList
Expand Down Expand Up @@ -169,6 +170,10 @@ window.mods.receive('fromMain_modList', (currLocale, modList, extraL10n, current
element.classList.remove('collapsed')
})
document.getElementById(lastOpenID).classList.add('show')
if ( lastOpenQ !== '' ) {
document.getElementById(lastOpenID).querySelector('input.mod-row-filter').value = lastOpenQ
select_lib.filter(lastOpenID)
}
window.scrollTo(0, scrollStart)
} catch { /* nope */ }

Expand Down

0 comments on commit 7df3145

Please sign in to comment.