Fix debounce of updateSort
This commit is contained in:
parent
edf44fbdf3
commit
01af7abb96
|
@ -156,7 +156,7 @@ function filterOnChange({target: el, forceRefilter}) {
|
||||||
if (installed) {
|
if (installed) {
|
||||||
reapplyFilter();
|
reapplyFilter();
|
||||||
}
|
}
|
||||||
updateSort();
|
debounce(updateSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ function handleUpdate(style, {reason, method} = {}) {
|
||||||
handleUpdateInstalled(entry, reason);
|
handleUpdateInstalled(entry, reason);
|
||||||
}
|
}
|
||||||
filterAndAppend({entry});
|
filterAndAppend({entry});
|
||||||
updateSort();
|
debounce(updateSort);
|
||||||
if (!entry.matches('.hidden') && reason !== 'import') {
|
if (!entry.matches('.hidden') && reason !== 'import') {
|
||||||
animateElement(entry);
|
animateElement(entry);
|
||||||
scrollElementIntoView(entry);
|
scrollElementIntoView(entry);
|
||||||
|
|
|
@ -135,11 +135,10 @@ function sortStyles({styles, parser}) {
|
||||||
function manageSort(event) {
|
function manageSort(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
prefs.set('manage.newUI.sort', this.value);
|
prefs.set('manage.newUI.sort', this.value);
|
||||||
updateSort();
|
debounce(updateSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSort() {
|
function updateSort() {
|
||||||
debounce(() => {
|
|
||||||
const renderBin = document.createDocumentFragment();
|
const renderBin = document.createDocumentFragment();
|
||||||
const entries = sortStyles({parser: 'entry'});
|
const entries = sortStyles({parser: 'entry'});
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
|
@ -147,7 +146,6 @@ function updateSort() {
|
||||||
}
|
}
|
||||||
installed.appendChild(renderBin);
|
installed.appendChild(renderBin);
|
||||||
updateStripes();
|
updateStripes();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSortHelp(event) {
|
function showSortHelp(event) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ function reportUpdateState(state, style, details) {
|
||||||
}
|
}
|
||||||
if (filtersSelector.hide) {
|
if (filtersSelector.hide) {
|
||||||
filterAndAppend({entry});
|
filterAndAppend({entry});
|
||||||
updateSort();
|
debounce(updateSort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user