Skip to content

Commit

Permalink
add Ctrl+Click and Ctrl+A select, improve tabindex for collections
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Feb 22, 2024
1 parent cfb1f7d commit 7c3a954
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions client/src/components/History/Content/ContentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
:is-visible="item.visible"
:state="state"
:item-urls="itemUrls"
:keyboard-selectable="expandDataset"
:keyboard-selectable="isCollection || expandDataset"
@delete="onDelete"
@display="onDisplay"
@showCollectionInfo="onShowCollectionInfo"
Expand Down Expand Up @@ -243,19 +243,23 @@ export default {
} else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
event.preventDefault();
this.$emit("arrow-navigate", event.key);
} else if (event.key === "Delete") {
} else if (event.key === "Delete" && !this.selected && !this.item.deleted) {
event.preventDefault();
this.onDelete(event.shiftKey);
} else if (event.key === "Escape") {
event.preventDefault();
this.$emit("hide-selection");
} else if (event.key === "a" && event.ctrlKey) {
event.preventDefault();
this.$emit("select-all");
}
},
onClick() {
if (this.isPlaceholder) {
onClick(event) {
if (event && event.ctrlKey) {
this.$emit("update:selected", !this.selected);
} else if (this.isPlaceholder) {
return;
}
if (this.isDataset) {
} else if (this.isDataset) {
this.$emit("update:expand-dataset", !this.expandDataset);
} else {
this.$emit("view-collection", this.item, this.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ function arrowNavigate(item: HistoryItem, eventKey: string) {
"
@hide-selection="setShowSelection(false)"
@shift-select="(eventKey) => shiftSelect(nextSelections(item, eventKey))"
@select-all="selectAllInCurrentQuery(historyItems)"
@tag-click="updateFilterValue('tag', $event)"
@tag-change="onTagChange"
@toggleHighlights="updateFilterValue('related', item.hid)"
Expand Down

0 comments on commit 7c3a954

Please sign in to comment.