mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove pointless DOM call
This commit is contained in:
@@ -1942,7 +1942,6 @@ function clearEntryList() {
|
|||||||
console.time('clearEntryList');
|
console.time('clearEntryList');
|
||||||
const $list = $('#world_popup_entries_list');
|
const $list = $('#world_popup_entries_list');
|
||||||
|
|
||||||
|
|
||||||
if (!$list.children().length) {
|
if (!$list.children().length) {
|
||||||
console.debug('List already empty, skipping cleanup.');
|
console.debug('List already empty, skipping cleanup.');
|
||||||
console.timeEnd('clearEntryList');
|
console.timeEnd('clearEntryList');
|
||||||
@@ -1977,7 +1976,6 @@ function clearEntryList() {
|
|||||||
|
|
||||||
$select.off();
|
$select.off();
|
||||||
$.cleanData([$select[0]]);
|
$.cleanData([$select[0]]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Step 3: Clean <div>, <span>, <input>
|
// Step 3: Clean <div>, <span>, <input>
|
||||||
@@ -1993,13 +1991,12 @@ function clearEntryList() {
|
|||||||
$list.sortable('destroy');
|
$list.sortable('destroy');
|
||||||
}
|
}
|
||||||
|
|
||||||
let totalElementsOfanyKindLeftInList = $list.children().length;
|
const totalElementsOfAnyKindLeftInList = $list.children().length;
|
||||||
|
|
||||||
// Final cleanup
|
// Final cleanup
|
||||||
if (totalElementsOfanyKindLeftInList !== 0) {
|
if (totalElementsOfAnyKindLeftInList) {
|
||||||
console.time('empty');
|
console.time('empty');
|
||||||
$list.empty();
|
$list.empty();
|
||||||
totalElementsOfanyKindLeftInList = $list.children().length;
|
|
||||||
console.timeEnd('empty');
|
console.timeEnd('empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user