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

SwappingViewController

Extends:

ViewController → SwappingViewController

Allows swapping between two views

Constructor Summary

Public Constructor
public

constructor(source: HTMLElement)

Method Summary

Public Methods
public

displayAlternate(alternate: Template): HTMLElement

Swaps to an alternate view

public

Shows the original view

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

Public Constructors

public constructor(source: HTMLElement) source

Override:

ViewController#constructor

Params:

NameTypeAttributeDescription
source HTMLElement

The original HTML element

Public Methods

public displayAlternate(alternate: Template): HTMLElement source

Swaps to an alternate view

Params:

NameTypeAttributeDescription
alternate Template

New elem to show

Return:

HTMLElement

public restoreOriginal() source

Shows the original view