Options
All
  • Public
  • Public/Protected
  • All
Menu

A simple button that can be clicked.

Hierarchy

Index

Constructors

constructor

  • new Button(desc: string, abbreviatedDesc: string | undefined, icon?: string, extraClass?: string): Button
  • Parameters

    • desc: string

      The full description of what the button does. This will be used in the button's tooltip.

    • abbreviatedDesc: string | undefined

      An abbreviated description. This may be used as text inside the button.

    • Default value icon: string = ""

      An optional icon for the button.

    • Default value extraClass: string = ""

      Extra classes to add to className.

    Returns Button

Properties

Protected _events

_events: Subject<ClickEvent> = new Subject()

The object on which this class and subclasses may push new events.

abbreviatedDesc

abbreviatedDesc: string | undefined

An abbreviated description. This may be used as text inside the button.

desc

desc: string

The full description of what the button does. This will be used in the button's tooltip.

Protected el

el: Element | undefined

The current DOM element representing the button, if it has been rendered already.

events

events: Observable<ClickEvent> = this._events.asObservable()

The observable on which clients can listen for events.

extraClass

extraClass: string

Extra classes to add to className.

icon

icon: string

An optional icon for the button.

Accessors

Protected buttonClassName

  • get buttonClassName(): string

Protected buttonText

  • get buttonText(): string
  • The text that goes inside a button. This is the abbreviated description, or if unavailable, the long description.

    Returns string

Methods

Protected makeButton

  • makeButton(doc: Document): Element
  • Create a button, fill its contents, set its tooltip and add the event handlers.

    Parameters

    • doc: Document

      The document in which we are creating the element.

    Returns Element

    The new button.

render

  • render(parent?: Element | Document | DocumentFragment): void
  • Render the button.

    Parameters

    • Optional parent: Element | Document | DocumentFragment

      On first render, this parameter must contain the parent DOM element of the button. On later renders, this parameter is ignored.

    Returns void

Protected setButtonContent

  • setButtonContent(button: Element): void
  • Fill the content of the button.

    Parameters

    • button: Element

      The button to fill.

    Returns void

setButtonEventHandlers

  • setButtonEventHandlers($button: JQuery): void
  • Set event handlers on the button.

    Parameters

    • $button: JQuery

    Returns void

Protected setButtonTooltip

  • setButtonTooltip($button: JQuery): void
  • Make a tooltip for the button.

    Parameters

    • $button: JQuery

      The button for which to make a tooltip.

    Returns void

Generated using TypeDoc