Remove tab content immediately
Amends 30c70a6ecd
.
On some machines, the callback added in that change would never actually run, so
memory usage would grow quickly when switching between tabs. By wrapping in
setTimeout() instead of requestIdleCallback(), we keep the performance gains
from removing once the element is no longer visible (so we can avoid repaints,
rebuilding the layout tree, etc.), but we make sure that the callback gets
called nearly immediately.
#3321
This commit is contained in:
parent
8d93fd4c8c
commit
87286ca776
1 changed files with 1 additions and 1 deletions
|
@ -288,7 +288,7 @@ var Zotero_Tabs = new function () {
|
|||
historyEntry.push({ index: tmpTabs.indexOf(tab), data: tab.data });
|
||||
closedIDs.push(id);
|
||||
|
||||
requestIdleCallback(() => {
|
||||
setTimeout(() => {
|
||||
document.getElementById(tab.id).remove();
|
||||
// For unknown reason fx102, unlike 60, sometimes doesn't automatically update selected index
|
||||
let selectedIndex = Array.from(this.deck.children).findIndex(x => x.id == this._selectedID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue