From c8f9a1b5d3741f7e728de86187e3f50999d5cc8b Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Thu, 7 Apr 2022 19:48:17 +0300 Subject: [PATCH] updated help mode to open directly the docs if there is only one key for a specific view --- .../help-button/help-button.component.html | 4 ++-- .../help-button/help-button.component.ts | 24 ++++++++++++++++--- src/lib/help-mode/help-mode.service.ts | 2 ++ .../help-mode/help-mode.component.ts | 5 ++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/lib/buttons/help-button/help-button.component.html b/src/lib/buttons/help-button/help-button.component.html index d0b79a1..bac8fc3 100644 --- a/src/lib/buttons/help-button/help-button.component.html +++ b/src/lib/buttons/help-button/help-button.component.html @@ -1,13 +1,13 @@ >, @Inject(MANUAL_BASE_URL) private readonly _manualBaseURL: string, diff --git a/src/lib/help-mode/help-mode/help-mode.component.ts b/src/lib/help-mode/help-mode/help-mode.component.ts index 1fcd619..89a2663 100644 --- a/src/lib/help-mode/help-mode/help-mode.component.ts +++ b/src/lib/help-mode/help-mode/help-mode.component.ts @@ -22,6 +22,11 @@ export class HelpModeComponent { @HostListener('document:keydown.h', ['$event']) onHKeydownHandler(event: KeyboardEvent): void { const node = (event.target as IqserEventTarget).localName; if (!this.helpModeService.isHelpModeActive && node !== 'input' && node !== 'textarea') { + if (this.helpModeService.helpButtonKey) { + const url = this.helpModeService.getDocsLink(this.helpModeService.helpButtonKey); + window.open(url, '_blank'); + return; + } const dialogMode = !!this._dialog.openDialogs.length; this.helpModeService.activateHelpMode(dialogMode); }