Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StickyScrollComponent

whatitdoes

Sets the positionContainer fixed to top when it reaches the top while the host element acts as a placeholder in the DOM

consumers

FilterComponent

Hierarchy

  • StickyScrollComponent

Implements

  • AfterViewInit
  • OnChanges
  • OnDestroy
  • OnInit

Index

Constructors

constructor

Properties

Private element

element: ElementRef

fixed

fixed: boolean = false

Set to true if the host element should be fixed to the top of the screen.

Private globalEventsService

globalEventsService: GlobalEventsService

provides a subscription to global events

height

height: number

The height of the positionContainer

Private minScroll

minScroll: number

The minimum number of pixels that should be scrolled before fixed is set to true.

Private positionContainer

positionContainer: ElementRef

The actual content that gets fixed on scroll

Private renderer

renderer: Renderer

used to make DOM changes to the host element

Private statusBarService

statusBarService: StatusBarService

stickyOffset

stickyOffset: number

An additional amount of px that must be scrolled before sticking takes effect

Methods

Private getDimensions

  • getDimensions(): void
  • Get dimensions related to fixing the host element.

    1. Remove fixed position: fixed (if fixed) to get original position from top
    2. Get the minimum scroll distance from the elements position from the top and any offset distance given via stickyOffset
    3. Then update the position which will immediately restore position: fixed if appropriate

    Returns void

manualHeightCheck

  • manualHeightCheck(): void

ngAfterViewInit

  • ngAfterViewInit(): void

ngOnChanges

  • ngOnChanges(): void

ngOnDestroy

  • ngOnDestroy(): void

ngOnInit

  • ngOnInit(): void

Private updatePosition

  • updatePosition(): void

Object literals

Private subscriptions

subscriptions: object

Subscriptions to observables that need to be unsubscribed when the ngOnDestroy lifecycle hook is called.

resize

resize: null = null

scroll

scroll: null = null

Generated using TypeDoc