Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getSliderStartPosition(): number {
if (this.cacheSliderStart !== null) {
return this.cacheSliderStart;
}
const offset = getElementOffset(this.sliderDOM);
return this.nzVertical ? offset.top : offset.left;
}
private updateTransformOrigin(): void {
const modalElement = this.modalContainer.nativeElement as HTMLElement;
if (this.previouslyFocusedElement) {
const previouslyDOMRect = this.previouslyFocusedElement.getBoundingClientRect();
const lastPosition = getElementOffset(this.previouslyFocusedElement);
const x = lastPosition.left + previouslyDOMRect.width / 2;
const y = lastPosition.top + previouslyDOMRect.height / 2;
this.transformOrigin = `${x - modalElement.offsetLeft}px ${y - modalElement.offsetTop}px 0px`;
}
}