Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LocationService

Hierarchy

  • LocationService

Index

Constructors

constructor

  • Register to page changes, target-pointer changes or to (re)scroll to the current pointer in view.

    The LocationService manages global pointer states and scroll position:

    • the "current pointer" tracks the currently focused editor and
    • the "page pointer" corresponds to the first property of "current pointer", which may be used for main page loading

    Motivation

    Jumping to specific editors via the navigation requires a targeting system. A page reload may occur for a called anchor, and thus is scrolled into view async. In other cases the current view may be completely rebuilt which resets the scroll position to top. A stored pointer (current) may be used to retrieve the scroll position. named anchors fail when hash routes are present. Thus anchors are processed via javascript.

    Parameters

    • options: Options = ...

    Returns LocationService

Properties

PAGE_EVENT

PAGE_EVENT: string = "page"

TARGET_EVENT

TARGET_EVENT: string = "target"

options

options: Options

timeout

timeout: Timeout

watcher

watcher: LocationWatcher[] = ...

Methods

blur

  • blur(pointer: string): void

destroy

  • destroy(): void

focus

  • focus(rootElement?: HTMLElement): void

focusInputElement

  • focusInputElement(pointer: string, rootElement?: HTMLElement): void
  • trigger focus in input element. Will be ignored, if this is no input element

    Parameters

    • pointer: string
    • rootElement: HTMLElement = ...

    Returns void

getCurrent

  • getCurrent(): string

goto

  • goto(targetPointer: string, rootElement?: HTMLElement): void

notifyWatcher

removeWatcher

setCurrent

  • setCurrent(pointer: string): void

watch

Generated using TypeDoc