From a6d59a82b9bade66f0e49bbaaa8e9cc7e8f626a8 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Thu, 2 Feb 2023 12:06:22 +0200 Subject: [PATCH] lint --- src/lib/help-mode/help-mode.directive.ts | 2 +- src/lib/help-mode/help-mode.service.ts | 33 +++++++++++++----------- src/lib/help-mode/utils/constants.ts | 10 ++++--- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/lib/help-mode/help-mode.directive.ts b/src/lib/help-mode/help-mode.directive.ts index 89990bb..ab9fb08 100644 --- a/src/lib/help-mode/help-mode.directive.ts +++ b/src/lib/help-mode/help-mode.directive.ts @@ -39,7 +39,7 @@ export class HelpModeDirective implements OnInit { scrollableParentView: this.scrollableParentView, overlappingElements: this.overlappingElements, dialogElement: this.dialogElement, - } + }; this._helpModeService.addHelper(helperKey, helper); } diff --git a/src/lib/help-mode/help-mode.service.ts b/src/lib/help-mode/help-mode.service.ts index c45cb46..9ae5e6a 100644 --- a/src/lib/help-mode/help-mode.service.ts +++ b/src/lib/help-mode/help-mode.service.ts @@ -6,12 +6,17 @@ import { HelpModeDialogComponent } from './help-mode-dialog/help-mode-dialog.com import { HELP_DOCS, MANUAL_BASE_URL } from './tokens'; import { HelpDocs } from './help-docs'; import { - ANNOTATIONS_LIST_ID, HELP_HIGHLIGHT_CLASS, HELP_MODE_CLASS, OVERLAPPING_DROPDOWNS_IDS, - OverlappingElement, PDF_TRON_IFRAME_ID, + ANNOTATIONS_LIST_ID, + HELP_HIGHLIGHT_CLASS, + HELP_MODE_CLASS, + OVERLAPPING_DROPDOWNS_IDS, + OverlappingElement, + PDF_TRON_IFRAME_ID, SCROLL_BUTTONS_IDS, ScrollableParentView, ScrollableParentViews, - VIRTUAL_SCROLL_ID, WEB_VIEWER_ELEMENTS + VIRTUAL_SCROLL_ID, + WEB_VIEWER_ELEMENTS, } from './utils/constants'; export interface Helper { @@ -103,7 +108,7 @@ export class HelpModeService { const iframe: HTMLIFrameElement = document.getElementById(PDF_TRON_IFRAME_ID) as HTMLIFrameElement; if (iframe) { WEB_VIEWER_ELEMENTS.forEach(e => { - const element: HTMLElement = iframe.contentWindow?.document.querySelector(e.querySelector) as HTMLElement; + const element: HTMLElement = iframe.contentWindow?.document.querySelector(e.querySelector) as HTMLElement; const helperElement: HTMLElement = this.#renderer.createElement('a') as HTMLElement; this.#renderer.setAttribute(helperElement, 'href', this.getDocsLink(e.helpModeKey)); @@ -114,15 +119,14 @@ export class HelpModeService { element, helperElement, dialogElement: false, - iframeElement: true - } + iframeElement: true, + }; - this.addHelper(e.helpModeKey, helper) - }) + this.addHelper(e.helpModeKey, helper); + }); } } - addHelper(helperKey: string, helper: Helper): void { this.#helpers[helperKey] = helper; } @@ -226,12 +230,11 @@ export class HelpModeService { #enableHelperElements() { Object.values(this.#helpers).forEach(helper => { - if (this.#dialogMode === helper.dialogElement) { - document.body.appendChild(helper.helperElement); - this.#updateHelperElement(helper); - } - }, - ); + if (this.#dialogMode === helper.dialogElement) { + document.body.appendChild(helper.helperElement); + this.#updateHelperElement(helper); + } + }); } #disableHelperElements() { diff --git a/src/lib/help-mode/utils/constants.ts b/src/lib/help-mode/utils/constants.ts index b55b802..22a8fad 100644 --- a/src/lib/help-mode/utils/constants.ts +++ b/src/lib/help-mode/utils/constants.ts @@ -7,10 +7,12 @@ export const OVERLAPPING_DROPDOWNS_IDS = { }; export const SCROLL_BUTTONS_IDS = ['scroll-up', 'scroll-down']; export const PDF_TRON_IFRAME_ID = 'webviewer-1'; -export const WEB_VIEWER_ELEMENTS = [{ - querySelector: '.HeaderItems', - helpModeKey: 'pdf_features' -}]; +export const WEB_VIEWER_ELEMENTS = [ + { + querySelector: '.HeaderItems', + helpModeKey: 'pdf_features', + }, +]; export const ScrollableParentViews = { VIRTUAL_SCROLL: 'VIRTUAL_SCROLL',