Home Reference Source
import LoadingButtonController from '~/controllers/LoadingButtonController.js'
public class | source

LoadingButtonController

Extends:

ViewControllerProgressButtonController → LoadingButtonController

Allows button classes with images to have a loading/disabled state. Expects an SVG as the image.

This is a better version of ProgressButtonController that supports reactive observables.

Constructor Summary

Public Constructor
public

constructor(button: HTMLElement)

Creates a button to wrap the thing.

Member Summary

Public Members
public

button: HTMLElement

public set

If the button is in progress

Method Summary

Public Methods
public

observeClick(): Observable

Observes the click of the button

Inherited Summary

From class ViewController
public static

forClass(className: string, predicate: Function, root: HTMLElement)

Creates a view controller directly for all members of a class.

public static

of(elem: string | Element): ViewController

Returns a canolical VC of an element if it exists

From class ProgressButtonController
public

button: HTMLElement

public

buttonChildren: HTMLElement[]

public
public
public

setLoadingState(isLoading: Boolean)

Sets into a loading state

Public Constructors

public constructor(button: HTMLElement) source

Creates a button to wrap the thing.

Override:

ProgressButtonController#constructor

Params:

NameTypeAttributeDescription
button HTMLElement

The element with desired default children.

Public Members

public button: HTMLElement source

Override:

ProgressButtonController#button

public set isInProgress: Boolean source

If the button is in progress

Return:

Boolean

Public Methods

public observeClick(): Observable source

Observes the click of the button

Return:

Observable