lint
This commit is contained in:
parent
76ee8afbc2
commit
a6d59a82b9
@ -39,7 +39,7 @@ export class HelpModeDirective implements OnInit {
|
|||||||
scrollableParentView: this.scrollableParentView,
|
scrollableParentView: this.scrollableParentView,
|
||||||
overlappingElements: this.overlappingElements,
|
overlappingElements: this.overlappingElements,
|
||||||
dialogElement: this.dialogElement,
|
dialogElement: this.dialogElement,
|
||||||
}
|
};
|
||||||
|
|
||||||
this._helpModeService.addHelper(helperKey, helper);
|
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 { HELP_DOCS, MANUAL_BASE_URL } from './tokens';
|
||||||
import { HelpDocs } from './help-docs';
|
import { HelpDocs } from './help-docs';
|
||||||
import {
|
import {
|
||||||
ANNOTATIONS_LIST_ID, HELP_HIGHLIGHT_CLASS, HELP_MODE_CLASS, OVERLAPPING_DROPDOWNS_IDS,
|
ANNOTATIONS_LIST_ID,
|
||||||
OverlappingElement, PDF_TRON_IFRAME_ID,
|
HELP_HIGHLIGHT_CLASS,
|
||||||
|
HELP_MODE_CLASS,
|
||||||
|
OVERLAPPING_DROPDOWNS_IDS,
|
||||||
|
OverlappingElement,
|
||||||
|
PDF_TRON_IFRAME_ID,
|
||||||
SCROLL_BUTTONS_IDS,
|
SCROLL_BUTTONS_IDS,
|
||||||
ScrollableParentView,
|
ScrollableParentView,
|
||||||
ScrollableParentViews,
|
ScrollableParentViews,
|
||||||
VIRTUAL_SCROLL_ID, WEB_VIEWER_ELEMENTS
|
VIRTUAL_SCROLL_ID,
|
||||||
|
WEB_VIEWER_ELEMENTS,
|
||||||
} from './utils/constants';
|
} from './utils/constants';
|
||||||
|
|
||||||
export interface Helper {
|
export interface Helper {
|
||||||
@ -103,7 +108,7 @@ export class HelpModeService {
|
|||||||
const iframe: HTMLIFrameElement = document.getElementById(PDF_TRON_IFRAME_ID) as HTMLIFrameElement;
|
const iframe: HTMLIFrameElement = document.getElementById(PDF_TRON_IFRAME_ID) as HTMLIFrameElement;
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
WEB_VIEWER_ELEMENTS.forEach(e => {
|
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;
|
const helperElement: HTMLElement = this.#renderer.createElement('a') as HTMLElement;
|
||||||
this.#renderer.setAttribute(helperElement, 'href', this.getDocsLink(e.helpModeKey));
|
this.#renderer.setAttribute(helperElement, 'href', this.getDocsLink(e.helpModeKey));
|
||||||
@ -114,15 +119,14 @@ export class HelpModeService {
|
|||||||
element,
|
element,
|
||||||
helperElement,
|
helperElement,
|
||||||
dialogElement: false,
|
dialogElement: false,
|
||||||
iframeElement: true
|
iframeElement: true,
|
||||||
}
|
};
|
||||||
|
|
||||||
this.addHelper(e.helpModeKey, helper)
|
this.addHelper(e.helpModeKey, helper);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
addHelper(helperKey: string, helper: Helper): void {
|
addHelper(helperKey: string, helper: Helper): void {
|
||||||
this.#helpers[helperKey] = helper;
|
this.#helpers[helperKey] = helper;
|
||||||
}
|
}
|
||||||
@ -226,12 +230,11 @@ export class HelpModeService {
|
|||||||
|
|
||||||
#enableHelperElements() {
|
#enableHelperElements() {
|
||||||
Object.values(this.#helpers).forEach(helper => {
|
Object.values(this.#helpers).forEach(helper => {
|
||||||
if (this.#dialogMode === helper.dialogElement) {
|
if (this.#dialogMode === helper.dialogElement) {
|
||||||
document.body.appendChild(helper.helperElement);
|
document.body.appendChild(helper.helperElement);
|
||||||
this.#updateHelperElement(helper);
|
this.#updateHelperElement(helper);
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#disableHelperElements() {
|
#disableHelperElements() {
|
||||||
|
|||||||
@ -7,10 +7,12 @@ export const OVERLAPPING_DROPDOWNS_IDS = {
|
|||||||
};
|
};
|
||||||
export const SCROLL_BUTTONS_IDS = ['scroll-up', 'scroll-down'];
|
export const SCROLL_BUTTONS_IDS = ['scroll-up', 'scroll-down'];
|
||||||
export const PDF_TRON_IFRAME_ID = 'webviewer-1';
|
export const PDF_TRON_IFRAME_ID = 'webviewer-1';
|
||||||
export const WEB_VIEWER_ELEMENTS = [{
|
export const WEB_VIEWER_ELEMENTS = [
|
||||||
querySelector: '.HeaderItems',
|
{
|
||||||
helpModeKey: 'pdf_features'
|
querySelector: '.HeaderItems',
|
||||||
}];
|
helpModeKey: 'pdf_features',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export const ScrollableParentViews = {
|
export const ScrollableParentViews = {
|
||||||
VIRTUAL_SCROLL: 'VIRTUAL_SCROLL',
|
VIRTUAL_SCROLL: 'VIRTUAL_SCROLL',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user