Closes #1644, Allow selecting multiple items with zotero://select

This adds selectItems() to ZoteroPane and collectionTreeView and removes
the ancient, unused 'expand' argument to selectItem(), which didn't
really make sense there. It also includes a new
itemTreeView::ensureRowsAreVisible() that tries to scroll to an
appropriate place (or, better yet, not scroll at all) given the
specified rows and page size.
This commit is contained in:
Dan Stillman 2019-02-23 17:28:44 -05:00
parent 4d3625f101
commit 945c413c42
8 changed files with 331 additions and 185 deletions

View file

@ -849,6 +849,12 @@ function ZoteroProtocolHandler() {
router.run(path);
Zotero.API.parseParams(params);
if (!params.objectKey && !params.objectID && !params.itemKey) {
Zotero.debug("No objects specified");
return;
}
var results = yield Zotero.API.getResultsFromParams(params);
if (!results.length) {
@ -868,8 +874,7 @@ function ZoteroProtocolHandler() {
return zp.collectionsView.selectCollection(results[0].id);
}
else {
// TODO: Currently only able to select one item
return zp.selectItem(results[0].id);
return zp.selectItems(results.map(x => x.id));
}
}),