check if body contains helper element before removing it

This commit is contained in:
Valentin Mihai 2022-02-14 11:13:34 +02:00
parent 6bc8881a8f
commit d9d8dcc7f4
3 changed files with 5 additions and 3 deletions

View File

@ -54,7 +54,7 @@ export class HelpModeService {
}
getDocsLink(elementName: string): string {
return `${this._manualBaseURL}${this._docs[elementName][this._translateService.currentLang]}`;
return this._docs[elementName] ? `${this._manualBaseURL}${this._docs[elementName][this._translateService.currentLang]}` : '';
}
activateHelpMode(): void {
@ -112,7 +112,9 @@ export class HelpModeService {
private _disableHelperElements() {
Object.values(this._helperElements).forEach(({ helperElement }) => {
document.body.removeChild(helperElement)
if (document.body.contains(helperElement)) {
document.body.removeChild(helperElement);
}
});
}

View File

@ -3,5 +3,4 @@ import { ActionConfig } from './action-config.model';
export interface ButtonConfig extends ActionConfig {
readonly type?: IconButtonType;
readonly helpModeKey?: string;
}

View File

@ -44,6 +44,7 @@
[icon]="config.icon"
[tooltip]="config.label"
tooltipPosition="below"
[iqserHelpMode]="config.helpModeKey"
></iqser-circle-button>
</ng-container>