Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/infrastructure/HtmlUtils"

Index

Functions

clearRequestInterval

  • clearRequestInterval(handle: object): void
  • Behaves the same as clearInterval except uses cancelRequestAnimationFrame() for better performance

    Parameters

    • handle: object
      • value: number

    Returns void

Private getClosest

  • getClosest(elem: HTMLElement, selector: string): HTMLElement
  • Get the closest matching element up the DOM tree.

    Parameters

    • elem: HTMLElement

      Starting element

    • selector: string

      Selector to match against

    Returns HTMLElement

pollUntil

  • pollUntil(callback: function, interval?: number, timeout?: number): Promise<void>
  • Polls until a certain criteria is met, or a timeout occurs.

    Parameters

    • callback: function

      The function used to check if a condition is met.

        • (): boolean
        • Returns boolean

    • Optional interval: number

      The fequency with which to poll in milliseconds.

    • Optional timeout: number

      The total amount of time that will be waited before timing out, in milliseconds.

    Returns Promise<void>

requestInterval

  • requestInterval(callback: function, delay?: number): object
  • Behaves the same as setInterval except uses requestAnimationFrame() for better performance Returns an object with the handle as a property so that this can be mutated as we go through successive animation frames

    Parameters

    • callback: function
        • (): void
        • Returns void

    • Optional delay: number

      The delay in milliseconds

    Returns object

    • value: number