Add select page shortcut key
This commit is contained in:
parent
f643938573
commit
57b129de41
@ -620,6 +620,10 @@ describe('DocumentListComponent', () => {
|
||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'a' }))
|
||||
expect(selectAllSpy).toHaveBeenCalled()
|
||||
|
||||
const selectPageSpy = jest.spyOn(documentListService, 'selectPage')
|
||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'p' }))
|
||||
expect(selectPageSpy).toHaveBeenCalled()
|
||||
|
||||
jest.spyOn(documentListService, 'documents', 'get').mockReturnValue(docs)
|
||||
fixture.detectChanges()
|
||||
const detailSpy = jest.spyOn(component, 'openDocumentDetail')
|
||||
|
@ -208,6 +208,13 @@ export class DocumentListComponent
|
||||
this.list.selectAll()
|
||||
})
|
||||
|
||||
this.hotKeyService
|
||||
.addShortcut({ keys: 'p', description: $localize`Select page` })
|
||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||
.subscribe(() => {
|
||||
this.list.selectPage()
|
||||
})
|
||||
|
||||
this.hotKeyService
|
||||
.addShortcut({ keys: 'o', description: $localize`Open first document` })
|
||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||
|
Loading…
x
Reference in New Issue
Block a user