mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
committed by
Lorenz Hilpert
parent
15a4718e58
commit
a086111ab5
@@ -11,8 +11,6 @@ import { IconButtonComponent } from '@isa/ui/buttons';
|
||||
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
||||
import { debounceTime, fromEvent, switchMap } from 'rxjs';
|
||||
|
||||
export type ScrollTopPosition = { bottom?: string; right?: string };
|
||||
|
||||
@Component({
|
||||
selector: 'utils-scroll-top-button',
|
||||
imports: [IconButtonComponent],
|
||||
@@ -20,9 +18,6 @@ export type ScrollTopPosition = { bottom?: string; right?: string };
|
||||
template: `
|
||||
@if (display()) {
|
||||
<button
|
||||
[style.position]="isTargetElement() ? 'absolute' : 'fixed'"
|
||||
[style.bottom]="position().bottom ?? defaultPosition.bottom"
|
||||
[style.right]="position().right ?? defaultPosition.right"
|
||||
uiIconButton
|
||||
aria-label="Scroll to top"
|
||||
type="button"
|
||||
@@ -41,12 +36,6 @@ export type ScrollTopPosition = { bottom?: string; right?: string };
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ScrollTopButtonComponent {
|
||||
/** The default position of the button. */
|
||||
defaultPosition: ScrollTopPosition = { bottom: '1.5rem', right: '1.5rem' };
|
||||
|
||||
/** The position of the button. */
|
||||
position = input<ScrollTopPosition>(this.defaultPosition);
|
||||
|
||||
/** The scroll target, either `window` or a specific element. */
|
||||
target = input<Window | HTMLElement>(window);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user