Make preferences less janky, preload panes on hover, allow panes to delay visibility until promise resolves (#3363)

Prevents flashes of unlocalized labels and controls without values set.
Makes switching panes feel speedier overall because of preloading.

I thought there was an issue for the flashes of uninitialized content but can't
find it now.
This commit is contained in:
Abe Jellinek 2023-08-26 05:57:38 -04:00 committed by GitHub
parent b79e0b3d71
commit 85cade3fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 44 deletions

View file

@ -113,14 +113,7 @@ var loadPrefPane = async function (paneName) {
var win = await loadWindow("chrome://zotero/content/preferences/preferences.xhtml", {
pane: id
});
var doc = win.document;
while (true) {
var pane = doc.getElementById(id);
if (pane) {
break;
}
await delay(1);
}
await win.Zotero_Preferences.waitForFirstPaneLoad();
return win;
};