lint
This commit is contained in:
parent
76ee8afbc2
commit
a6d59a82b9
@ -39,7 +39,7 @@ export class HelpModeDirective implements OnInit {
|
||||
scrollableParentView: this.scrollableParentView,
|
||||
overlappingElements: this.overlappingElements,
|
||||
dialogElement: this.dialogElement,
|
||||
}
|
||||
};
|
||||
|
||||
this._helpModeService.addHelper(helperKey, helper);
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user