Always show items-loading message switching collections in citation dialogs

Previously it only showed if library data hadn't been loaded, but
sorting can also take a little time when switching between collections.
This commit is contained in:
Dan Stillman 2017-02-28 03:33:18 -05:00
parent 737f54a70c
commit 82b789e083

View file

@ -81,11 +81,12 @@ var onCollectionSelected = Zotero.Promise.coroutine(function* ()
collectionTreeRow.setSearch('');
Zotero.Prefs.set('lastViewedFolder', collectionTreeRow.id);
setItemsPaneMessage(Zotero.getString('pane.items.loading'));
// Load library data if necessary
var library = Zotero.Libraries.get(collectionTreeRow.ref.libraryID);
if (!library.getDataLoaded('item')) {
Zotero.debug("Waiting for items to load for library " + library.libraryID);
setItemsPaneMessage(Zotero.getString('pane.items.loading'));
yield library.waitForDataLoad('item');
}