mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Fix the "Edit → Select All" menu option not selecting items (#5626)
This commit is contained in:
parent
3f8a0b5b86
commit
8a57f6c45b
3 changed files with 19 additions and 2 deletions
|
|
@ -194,6 +194,10 @@ class TreeSelection {
|
|||
}
|
||||
this._updateTree();
|
||||
}
|
||||
|
||||
selectAll() {
|
||||
this.rangedSelect(0, this._tree.props.getRowCount() - 1, false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a shift-select from current pivot to provided index. Updates focused item to index.
|
||||
|
|
@ -597,7 +601,7 @@ class VirtualizedTable extends React.Component {
|
|||
if (this.props.multiSelect
|
||||
&& !e.shiftKey
|
||||
&& (Zotero.isMac ? (e.metaKey && !e.ctrlKey) : e.ctrlKey)) {
|
||||
this.selection.rangedSelect(0, this.props.getRowCount()-1, false, true);
|
||||
this.selection.selectAll();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -3121,6 +3121,18 @@ var ZoteroPane = new function () {
|
|||
return true;
|
||||
};
|
||||
|
||||
this.selectAll = function () {
|
||||
if (this.itemsView.domEl.contains(document.activeElement)) {
|
||||
this.itemsView.selection.selectAll();
|
||||
}
|
||||
else {
|
||||
const command = "cmd_selectAll";
|
||||
let controller = document.commandDispatcher.getControllerForCommand(command);
|
||||
if (controller && controller.isCommandEnabled(command)) {
|
||||
controller.doCommand(command);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.getSelectedLibraryID = function () {
|
||||
return this.collectionsView.getSelectedLibraryID();
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@
|
|||
<command id="cmd_zotero_newChildURLAttachment" oncommand="ZoteroPane.addAttachmentFromURI(true, ZoteroPane.getSelectedItems()[0].id)"/>
|
||||
<command id="cmd_zotero_newStandaloneNote" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>
|
||||
<command id="cmd_zotero_newChildNote" oncommand="ZoteroPane_Local.newChildNote(event.shiftKey);"/>
|
||||
<command id="cmd_zotero_selectAll" oncommand="ZoteroPane.selectAll();"/>
|
||||
|
||||
<command id="cmd_zotero_showTabsMenu" oncommand="Zotero_Tabs.showTabsMenu()"/>
|
||||
</commandset>
|
||||
|
|
@ -404,7 +405,7 @@
|
|||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"
|
||||
key="key_selectAll"
|
||||
command="cmd_selectAll" data-l10n-id="text-action-select-all"/>
|
||||
command="cmd_zotero_selectAll" data-l10n-id="text-action-select-all"/>
|
||||
<menuseparator class="menu-type-reader pdf"/>
|
||||
<menuitem
|
||||
id="edit-menuitem-rotate-left"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue