RED-10563: grouped key events and extracted the target check.
This commit is contained in:
parent
5515a5b4d6
commit
8c47a8b758
@ -210,29 +210,26 @@ export class FileHeaderComponent implements OnInit, AfterViewInit, OnDetach, OnD
|
||||
this._changeRef.markForCheck();
|
||||
}
|
||||
|
||||
if ($event.key === 'F5') {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
if (isTargetInput($event) || isTargetTextArea($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$event.ctrlKey && !$event.metaKey && ['f', 'F'].includes($event.key)) {
|
||||
// if you type in an input, don't toggle full-screen
|
||||
if (isTargetInput($event) || isTargetTextArea($event)) {
|
||||
return;
|
||||
}
|
||||
this.toggleFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
if (['h', 'H'].includes($event.key)) {
|
||||
if (isTargetInput($event) || isTargetTextArea($event)) {
|
||||
return;
|
||||
}
|
||||
this._ngZone.run(() => {
|
||||
window.focus();
|
||||
this._helpModeService.activateHelpMode(false);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if ($event.key === 'F5') {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
#openFullScreen() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user