mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-01 11:19:32 -05:00
Handle shift-clicking orignal item
This commit is contained in:
parent
4a359c8928
commit
2a1f486b1c
@ -267,9 +267,8 @@ export class DocumentListViewService {
|
|||||||
const toIndex = Math.max(this.lastSelectedDocumentIndex, documentToIndex)
|
const toIndex = Math.max(this.lastSelectedDocumentIndex, documentToIndex)
|
||||||
|
|
||||||
if (this.lastSelectedDocumentToIndex !== null &&
|
if (this.lastSelectedDocumentToIndex !== null &&
|
||||||
((this.lastSelectedDocumentToIndex > this.lastSelectedDocumentIndex && documentToIndex < this.lastSelectedDocumentIndex) ||
|
((this.lastSelectedDocumentToIndex > this.lastSelectedDocumentIndex && documentToIndex <= this.lastSelectedDocumentIndex) ||
|
||||||
(this.lastSelectedDocumentToIndex < this.lastSelectedDocumentIndex && documentToIndex > this.lastSelectedDocumentIndex))) {
|
(this.lastSelectedDocumentToIndex < this.lastSelectedDocumentIndex && documentToIndex >= this.lastSelectedDocumentIndex))) {
|
||||||
console.log('invert');
|
|
||||||
|
|
||||||
// new click is "opposite side" of anchor so we invert the old selection
|
// new click is "opposite side" of anchor so we invert the old selection
|
||||||
this.documents.slice(Math.min(this.lastSelectedDocumentIndex, this.lastSelectedDocumentToIndex), Math.max(this.lastSelectedDocumentIndex, this.lastSelectedDocumentToIndex) + 1).forEach(d => {
|
this.documents.slice(Math.min(this.lastSelectedDocumentIndex, this.lastSelectedDocumentToIndex), Math.max(this.lastSelectedDocumentIndex, this.lastSelectedDocumentToIndex) + 1).forEach(d => {
|
||||||
@ -282,7 +281,7 @@ export class DocumentListViewService {
|
|||||||
})
|
})
|
||||||
this.lastSelectedDocumentToIndex = documentToIndex
|
this.lastSelectedDocumentToIndex = documentToIndex
|
||||||
} else { // e.g. shift key but was first click
|
} else { // e.g. shift key but was first click
|
||||||
this.lastSelectedDocumentIndex = this.documentIndexInCurrentView(d.id)
|
this.toggleSelected(d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user