Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/infrastructure/ShellUtils"

Index

Functions

debounceEvents

  • debounceEvents(app: ViewerApplication, delegate: Function, targetEvents: string[], settleThresholdMs?: number): void
  • Debounces a given function and runs it once all target events have settled for a specified timeout (defaults to 200ms). This function cannot guarantee deterministic results and we don't recommend you use it unless absolutely necessary.

    Parameters

    • app: ViewerApplication

      The ViewerApplication invoking this function.

    • delegate: Function

      The function to execute after debouncing.

    • targetEvents: string[]

      The list of events that will cause the given delegate to get debounced.

    • Optional settleThresholdMs: number

    Returns void

debounceViewEvents

  • debounceViewEvents(app: ViewerApplication, delegate: Function, settleThresholdMs?: number): void
  • Debounces a given function and runs it once all view related events have settled for a specified timeout (defaults to 400ms). This function cannot guarantee deterministic results and we don't recommend you use it unless absolutely necessary. There may be points of failure introduced if, for instance, a large number of modules use it and activate views of their own. This may lead to unintended behavior.

    Parameters

    Returns void

hasClass

  • hasClass(target: any, className: string): boolean
  • A reliable way to test an element for a class that works in IE9

    Parameters

    • target: any
    • className: string

    Returns boolean

throttle

  • throttle(func: Function, wait: number, options?: object): Function
  • Returns a function, that, when invoked, will only be triggered at most once during a given window of time. Normally, the throttled function will run as much as it can, without ever going more than once per wait duration

    Parameters

    • func: Function

      Function to call

    • wait: number

      Time to throttle

    • Optional options: object

      If you'd like to disable the execution on the leading edge, pass {leading: false}. To disable execution on the trailing edge, ditto.

      • Optional leading?: boolean
      • Optional trailing?: boolean

    Returns Function