[bump npm] handle layout / order change on search if selected el is still part of the new search

This commit is contained in:
Kevin Ngo
2018-10-08 03:07:49 -07:00
parent 585a7600ac
commit ddb2deacd4
4 changed files with 21 additions and 2 deletions

View File

@@ -212,6 +212,7 @@ AFRAME.registerState({
challengeDataStore[result.id] = result
}
computeSearchPagination(state);
computeMenuSelectedChallengeIndex(state);
},
'enter-vr': (state) => {
@@ -248,6 +249,7 @@ function computeSearchPagination (state) {
i < state.search.page * SEARCH_PER_PAGE + SEARCH_PER_PAGE; i++) {
if (!state.search.results[i]) { break; }
state.searchResultsPage.push(state.search.results[i]);
state.search.results[i].index = i;
state.search.songNameTexts +=
truncate(state.search.results[i].songName, SONG_NAME_TRUNCATE).toUpperCase() + '\n';