Enhancement: next / previous shortcuts for document list (#8309)

This commit is contained in:
shamoon 2024-11-18 11:05:00 -08:00 committed by GitHub
parent e4578b4589
commit f0e71330ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 2 deletions

View file

@ -273,6 +273,30 @@ export class DocumentListComponent
}
}
})
this.hotKeyService
.addShortcut({
keys: 'control.arrowleft',
description: $localize`Previous page`,
})
.pipe(takeUntil(this.unsubscribeNotifier))
.subscribe(() => {
if (this.list.currentPage > 1) {
this.list.currentPage--
}
})
this.hotKeyService
.addShortcut({
keys: 'control.arrowright',
description: $localize`Next page`,
})
.pipe(takeUntil(this.unsubscribeNotifier))
.subscribe(() => {
if (this.list.currentPage < this.list.getLastPage()) {
this.list.currentPage++
}
})
}
ngOnDestroy() {