Options
All
  • Public
  • Public/Protected
  • All
Menu

Module layout

Index

Functions

  • block(): void
  • Blocks the UI so that the user can't type anything or click any elements. Note that this only applies to built-in input and features, for custom features use isBlocked to check whether input should be accepted.

    Use unblock to remove the block.

    Returns void

  • closeTag(targetWindow?: number): boolean
  • Close a tag that is currently open.

    Because the tags are added as DOM elements, the tag isn't really "open" in the sense that it would be missing the closing tag. Instead we jump out of the tag and set output focus back to its parent element.

    see

    openTag

    Parameters

    • targetWindow: number = 0

      The target window in the Haven engine. This is practically always 0.

    Returns boolean

    Returns true if a tag was open, false if we were already at the top window level and nothing was done.

  • focus(targetElement: string | PlainObject<any>, targetWindow?: number): boolean
  • Set output focus to an element.

    Parameters

    • targetElement: string | PlainObject<any>

      A jQuery object or selector

    • targetWindow: number = 0

      The target window in the Haven engine. This is practically always 0.

    Returns boolean

    Returns true if the focus was set successfully, false if the element wasn't found.

  • isBlocked(): boolean
  • Checks whether user input is blocked.

    since

    3.2.6

    Returns boolean

    Returns true if input is blocked, otherwise false.

  • openTag(tagName: string, classes: string, targetWindow?: number): true
  • Create a new HTML element, append it to the target window, and set the output focus to the element.

    Example:

    vorple.layout.openTag( 'div', 'vorple' )  -->  <div class="vorple"></div>
    
    see

    closeTag

    Parameters

    • tagName: string

      Name of the tag to create

    • classes: string

      Class names to add to the element

    • targetWindow: number = 0

      The target window in the Haven engine. This is practically always 0.

    Returns true

    Returns true.

  • scrollTo(target: string | PlainObject<any>, speed?: number): Promise<boolean>
  • Scroll an element into view. Scrolling is initiated only if the element isn't already fully in view or its top position is not in the top half of the page.

    If the element doesn't exist, the function doesn't do anything.

    Parameters

    • target: string | PlainObject<any>

      The target element

    • speed: number = 500

      The duration of the scroll animation in milliseconds

    Returns Promise<boolean>

    Returns a promise that resolves to true when the scroll animation ends, or resolves to false if no scrolling was needed (element doesn't exist or is already in view.)

  • scrollToEnd(speed?: number): Promise<void>
  • Scroll to the end of the document.

    Parameters

    • speed: number = 500

      The duration of the scroll animation in milliseconds

    Returns Promise<void>

    Returns a promise that resolves when the scroll animation ends.

  • unblock(): void

Generated using TypeDoc