Improve word render speed
This commit is contained in:
parent
d3c5633821
commit
d5edcaf6a5
|
@ -28,6 +28,7 @@ export function getSearchFilters() {
|
|||
export function getMatchingSearchWords() {
|
||||
const searchTerm = getSearchTerm();
|
||||
const filters = getSearchFilters();
|
||||
if (searchTerm !== '' || !filters.allPartsOfSpeechChecked) {
|
||||
const matchingWords = window.currentDictionary.words.slice().filter(word => {
|
||||
if (!filters.allPartsOfSpeechChecked) {
|
||||
const partOfSpeech = word.partOfSpeech === '' ? 'Unclassified' : word.partOfSpeech;
|
||||
|
@ -44,6 +45,9 @@ export function getMatchingSearchWords() {
|
|||
return matchingWords;
|
||||
}
|
||||
|
||||
return window.currentDictionary.words
|
||||
}
|
||||
|
||||
export function highlightSearchTerm(word) {
|
||||
const searchTerm = getSearchTerm();
|
||||
if (searchTerm) {
|
||||
|
|
Loading…
Reference in New Issue