Merge branch 'unprotected' into VM/RED-8748

This commit is contained in:
Valentin Mihai 2024-06-10 14:41:24 +03:00
commit e733adf374
2 changed files with 14 additions and 2 deletions

View File

@ -149,6 +149,10 @@ pre {
@include mixins.line-clamp(4);
}
.clamp-5 {
@include mixins.line-clamp(5);
}
.no-wrap {
white-space: nowrap;
}

View File

@ -1,5 +1,5 @@
/* eslint-disable @angular-eslint/prefer-on-push-component-change-detection */
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { AfterViewInit, Component, ElementRef, HostListener, Input, OnDestroy, OnInit } from '@angular/core';
import { HelpModeService } from '../index';
@Component({
@ -34,7 +34,7 @@ export class HelpButtonComponent implements OnInit, AfterViewInit, OnDestroy {
if (this.helpModeButton) {
setTimeout(() => {
const currentComponentRect = currentComponent.getBoundingClientRect();
this.helpModeButton.style.setProperty('position', 'fixed');
this.helpModeButton.style.setProperty('position', 'absolute');
this.helpModeButton.style.setProperty('top', `${currentComponentRect.top}px`);
this.helpModeButton.style.setProperty('left', `${currentComponentRect.left}px`);
document.body.appendChild(this.helpModeButton);
@ -57,4 +57,12 @@ export class HelpButtonComponent implements OnInit, AfterViewInit, OnDestroy {
}
this.helpModeService.activateHelpMode(this.dialogButton);
}
@HostListener('window:resize', ['$event'])
onResize() {
const currentComponent = this._elementRef.nativeElement;
const currentComponentRect = currentComponent.getBoundingClientRect();
this.helpModeButton?.style.setProperty('top', `${currentComponentRect.top}px`);
this.helpModeButton?.style.setProperty('left', `${currentComponentRect.left}px`);
}
}