diff --git a/chrome/content/zotero/integration/citationExplorer.js b/chrome/content/zotero/integration/citationExplorer.js
index 8d33861f0b..0ae8d50ec2 100644
--- a/chrome/content/zotero/integration/citationExplorer.js
+++ b/chrome/content/zotero/integration/citationExplorer.js
@@ -190,6 +190,7 @@ window.ZoteroDocumentCitations = {
regularOnly: true,
columns: itemColumns,
shouldListenForNotifications: false,
+ autoSelect: false,
onSelectionChange: this.onItemSelectionChange.bind(this),
onActivate: this.onItemActivate.bind(this),
emptyMessage: Zotero.getString('pane.items.loading'),
@@ -272,7 +273,7 @@ window.ZoteroDocumentCitations = {
// check if all citation items are linked
for (let citationItem of citation.citationItems) {
itemMap[citationItem.id].citedIn.push(citationIndex);
- isLinked = typeof citationItem.id == 'number';
+ isLinked = isLinked && typeof citationItem.id == 'number';
}
let title = await citation.field.getText();
if (citation.properties.plainCitation != title) {
@@ -343,6 +344,9 @@ window.ZoteroDocumentCitations = {
}
}
itemList.setHighlightedRows(highlightedItems);
+ const noneSelected = citationList.selection.selected.size === 0;
+ document.querySelector('#button-show-in-document').disabled = noneSelected;
+ document.querySelector('#button-edit-citation').disabled = noneSelected;
},
onCitationEdit: async function () {
@@ -366,22 +370,22 @@ window.ZoteroDocumentCitations = {
}
const item = itemList.getRow(itemList.selection.focused).ref;
const isUnlinked = typeof item.id != 'number';
- const isMultiple = itemList.selection.selected.size > 1;
- document.querySelector('#button-show-in-zotero').hidden = isMultiple || isUnlinked;
- document.querySelector('#button-relink-item').hidden = isMultiple || !isUnlinked;
- document.querySelector('#button-addTo-library').style.display = (isMultiple || !isUnlinked) ? 'none' : 'inherit';
+ const noneSelected = itemList.selection.selected.size === 0;
+ document.querySelector('#button-show-in-zotero').disabled = noneSelected || isUnlinked;
+ document.querySelector('#button-relink-item').disabled = noneSelected || !isUnlinked;
+ document.querySelector('#button-addTo-library').disabled = noneSelected || !isUnlinked;
await this.refreshCitationList();
},
onItemActivate: async function () {
- if (itemList.selection.selected.size > 1) return;
const item = itemList.getRow(itemList.selection.focused).ref;
if (typeof item.id != 'number') {
this.onItemRelink();
}
else {
- await Zotero.Utilities.Internal.showInLibrary(item);
+ await Zotero.Utilities.Internal.showInLibrary(
+ Array.from(itemList.selection.selected).map(index => itemList.getRow(index).ref));
}
},
diff --git a/chrome/content/zotero/integration/citationExplorer.xhtml b/chrome/content/zotero/integration/citationExplorer.xhtml
index 5f9d7d8db0..5ac5a06816 100644
--- a/chrome/content/zotero/integration/citationExplorer.xhtml
+++ b/chrome/content/zotero/integration/citationExplorer.xhtml
@@ -78,9 +78,8 @@
@@ -95,12 +94,11 @@
-
-
-
+
+
+ popup="item-addTo-menu" disabled="true"/>
diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx
index 19f305bfe7..29ffd57d35 100644
--- a/chrome/content/zotero/itemTree.jsx
+++ b/chrome/content/zotero/itemTree.jsx
@@ -923,6 +923,7 @@ var ItemTree = class ItemTree extends LibraryTree {
regularOnly: false,
multiSelect: true,
shouldListenForNotifications: true,
+ autoSelect: true,
columns: COLUMNS,
onContextMenu: noop,
onActivate: noop,
@@ -940,6 +941,8 @@ var ItemTree = class ItemTree extends LibraryTree {
regularOnly: PropTypes.bool,
multiSelect: PropTypes.bool,
shouldListenForNotifications: PropTypes.bool,
+ // Whether to automatically select the focused row when the tree is focused via tab key
+ autoSelect: PropTypes.bool,
columns: PropTypes.array,
onSelectionChange: PropTypes.func,
onContextMenu: PropTypes.func,
@@ -1409,7 +1412,7 @@ var ItemTree = class ItemTree extends LibraryTree {
* Select the first row when the tree is tabbed into with no selection.
*/
handleKeyUp = (event) => {
- if (!Zotero.locked && event.code === 'Tab' && this.selection.count == 0) {
+ if (!Zotero.locked && this.props.autoSelect && (event.code === 'Tab' || event.key.includes("Arrow")) && this.selection.count == 0) {
this.selection.select(this.selection.focused);
}
};
diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js
index c259bcc6b2..83ada1f24a 100644
--- a/chrome/content/zotero/xpcom/utilities_internal.js
+++ b/chrome/content/zotero/xpcom/utilities_internal.js
@@ -2041,9 +2041,12 @@ Zotero.Utilities.Internal = {
/**
* Select an object in the library tab of the main window
*
- * @param {Zotero.DataObject} - Data object (e.g., Zotero.Item) to select
+ * @param {Zotero.DataObject[]} - Data objects (e.g., Zotero.Item) to select
*/
- showInLibrary: async function (dataObject) {
+ showInLibrary: async function (dataObjects) {
+ if (!Array.isArray(dataObjects)) {
+ dataObjects = [dataObjects];
+ }
var pane = Zotero.getActiveZoteroPane();
// Open main window if it's not open (Mac)
if (!pane) {
@@ -2057,12 +2060,12 @@ Zotero.Utilities.Internal = {
});
pane = win.ZoteroPane;
}
- if (dataObject instanceof Zotero.Item) {
- pane.selectItem(dataObject.id);
- }
- else {
- throw new Error("Unimplemented");
- }
+ pane.selectItems(dataObjects.map(dataObject => {
+ if (dataObject instanceof Zotero.Item) {
+ return dataObject.id;
+ }
+ throw new Error(`Unsupported data object: ${dataObject}`);
+ }));
// Pull window to foreground
Zotero.Utilities.Internal.activate(pane.document.defaultView);
diff --git a/scss/abstracts/_layout.scss b/scss/abstracts/_layout.scss
index 8ac12fb9de..4989f28591 100644
--- a/scss/abstracts/_layout.scss
+++ b/scss/abstracts/_layout.scss
@@ -17,6 +17,6 @@
flex: 1
}
-.spacer {
- flex: 1;
+.right {
+ margin-left: auto !important;
}
\ No newline at end of file
diff --git a/scss/components/_citationExplorer.scss b/scss/components/_citationExplorer.scss
index f741366c6a..c270d738f9 100644
--- a/scss/components/_citationExplorer.scss
+++ b/scss/components/_citationExplorer.scss
@@ -1,5 +1,6 @@
#zotero-citation-explorer-dialog {
min-height: 500px;
+ min-width: 600px;
--split-button-icon-color: var(--accent-blue);
dialog {
@@ -10,10 +11,6 @@
search-textbox, input, button {
margin: 0;
}
-
- input + button {
- margin-left: 8px;
- }
.citation-explorer-grid {
display: grid;
@@ -77,7 +74,19 @@
.button-container {
border-bottom: var(--material-border-quarternary);
display: flex;
+ gap: 8px;
padding: 8px 16px;
+ min-width: 0;
+
+ .split-menu-button {
+ min-width: 0;
+ flex: 0 1 auto;
+
+ [anonid="button-image-and-text-box"] {
+ min-width: 0;
+ width: auto;
+ }
+ }
}
.diff-deleted {
diff --git a/scss/elements/_splitMenuButton.scss b/scss/elements/_splitMenuButton.scss
index 12f97cfe9d..0153402d32 100644
--- a/scss/elements/_splitMenuButton.scss
+++ b/scss/elements/_splitMenuButton.scss
@@ -34,6 +34,7 @@
display: flex;
align-items: center;
overflow: hidden;
+ min-width: 8px;
}
& [anonid="dropmarker-separator"] {