allow searching for hotkey values - #1509

This commit is contained in:
Eugene Pankov 2020-07-27 16:04:31 +02:00
parent 6d0b2608a2
commit efe390f68d
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 7 additions and 1 deletions

View File

@ -288,7 +288,7 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
th ID
th Hotkey
ng-container(*ngFor='let hotkey of hotkeyDescriptions')
tr(*ngIf='!hotkeyFilter || hotkey.name.toLowerCase().includes(hotkeyFilter.toLowerCase())')
tr(*ngIf='!hotkeyFilter || hotkeyFilterFn(hotkey, hotkeyFilter)')
td {{hotkey.name}}
td {{hotkey.id}}
td.pr-5

View File

@ -144,4 +144,10 @@ export class SettingsTabComponent extends BaseTabComponent {
}
ptr[prop] = value
}
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString() as string
return s.toLowerCase().includes(query.toLowerCase())
}
}