Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SfMoveInViewportDirective

API reference for SfMoveInViewportDirective

import {SfCommonModule} from "@progress/sitefinity-component-framework";


attribute: sfMoveInViewport description: Returns the element in the boundaries of the viewport

Hierarchy

  • SfMoveInViewportDirective

Implements

  • AfterViewInit

Index

Constructors

constructor

  • Parameters

    • window: any
    • element: ElementRef

    Returns SfMoveInViewportDirective

Properties

Private availableSpace

availableSpace: AvailableSpace

The available space for the element in case it has to be moved in one of the directions (top, left, bottom, right)

bottomTolerance

bottomTolerance: number = 0

Sets the minimal distance from the bottom of the element to the bottom of the viewport

Private element

element: ElementRef

Private elementBoundaries

elementBoundaries: any

DOMRect object providing information about the size of an element and its position relative to the viewport

handleMoveIndependently

handleMoveIndependently: boolean

Whether to set the css position, which returns the element into the viewport, Or handle this outside of the directive

movingDirections

movingDirections: EventEmitter<MovingDirections> = new EventEmitter<MovingDirections>()

Emits the direction in which the element should be moved to return to the viewport

Private parentBoundaries

parentBoundaries: any

DOMRect object of the parent, providing information about its size and its position relative to the viewport

Private viewportHeight

viewportHeight: number

The viewport height

Private viewportWidth

viewportWidth: number

The viewport width

Private window

window: any

Accessors

Private isLeftAligned

  • get isLeftAligned(): boolean
  • Whether the element is aligned left, relative to its parent

    Returns boolean

Methods

Private checkAvailableSpaceAround

  • checkAvailableSpaceAround(): void
  • Returns an object, specifying the available space for the element in each direction

    Returns void

Private checkIfInBoundaries

  • Returns an object, specifying the directions in which the element overflows from the viewport

    Returns OverflowingDimensions

Private fallbackLeft

  • fallbackLeft(): void
  • Sets left fallback

    Returns void

Private fallbackTop

  • fallbackTop(): void
  • Sets top fallback

    Returns void

ngAfterViewInit

  • ngAfterViewInit(): void
  • Returns void

Private returnInBoundaries

  • Returns the element in viewport boundaries

    Parameters

    Returns void

Private setLeftOrRight

  • setLeftOrRight(leftPosition?: string, rightPosition?: string): void
  • Sets the left or right positions of the element Emits movingDirectionsInfo

    Parameters

    • Optional leftPosition: string
    • Optional rightPosition: string

    Returns void

Private setLeftOrRightPosition

  • setLeftOrRightPosition(availableSpace: number, requiredSpace: number, leftPosition?: string, rightPosition?: string): void
  • Sets the left or right positions of the element or fallbacks if no space is available

    Parameters

    • availableSpace: number
    • requiredSpace: number
    • Optional leftPosition: string
    • Optional rightPosition: string

    Returns void

Private setTopOrBottomPosition

  • setTopOrBottomPosition(availableSpace: number, requiredSpace: number, topPosition: string): void
  • Sets the top or bottom positions of the element or fallbacks if no space is available

    Parameters

    • availableSpace: number
    • requiredSpace: number
    • topPosition: string

    Returns void

Object literals

movingDirectionsInfo

movingDirectionsInfo: object

Emits the direction in which the element should be moved to return to the viewport As well as the number of pixels it should be moved with

movedLeft

movedLeft: undefined = undefined

movedRight

movedRight: undefined = undefined

movedTop

movedTop: undefined = undefined

Generated using TypeDoc