Home Reference Source
import PopoverTemplate from '~/template/PopoverTemplate.js'
public class | source

PopoverTemplate

Extends:

Template → PopoverTemplate

Direct Subclass:

NotificationListTemplate

Constructor Summary

Public Constructor
public

constructor(body: HTMLElement, options: Object)

Creates popover template given body

Member Summary

Public Members
public

Align rightward

public

If the node has fixed full-width in responsive

Inherited Summary

From class Template
public static get

An empty template

public static

Performs a move TemplateType for a given HTML id to return a template based on the id's root.

public static

fromInnerHTML(wrapper: HTMLElement, innerHTML: string, type: TemplateType): Template

From innerHTML will wrap in div

public static

Creates template <div> with text.

public get

underlyingNode: HTMLElement

Returns the underlying element

public

defineLinkedClass(name: string, className: string, node: HTMLElement)

Defines a linked class

public

defineLinkedInput(name: string, input: HTMLElement)

Defines a linked input

public

defineLinkedText(name: string, defaultValue: string): Text

Creates a field w/ updating text

public abstract

async didInitialLoad()

Called when loaded the first time

public abstract

Called when the view has loaded

public

Called when disappeared

public

getParent(defaultElement: HTMLElement): HTMLElement

Gets the original parent or else a default

public

loadBeforeContext(elem: HTMLElement): HTMLElement

Loads before an element

public

loadInContext(parent: HTMLElement, allowDupliacte: boolean): HTMLElement

Loads the template in a context

public

loadReplacingContext(source: HTMLElement): HTMLElement

Loads and replaces

public

prependInContext(parent: HTMLElement, allowDupliacte: boolean): HTMLElement

Prepends the template in a context

public

Removes from the context.

public

unique(): HTMLElement

Returns a unique instance of the template as an HTMLElement.

public

async willInitialLoad()

Called before loaded the first time

public

Called right before the view will appear on screen

public

Called before disappearing

Public Constructors

public constructor(body: HTMLElement, options: Object) source

Creates popover template given body

Override:

Template#constructor

Params:

NameTypeAttributeDescription
body HTMLElement

The body of the popover

options Object
  • optional
  • default: {}

The options of the popover

options.isFixed boolean
  • optional
  • default: false

If to use a responsive full-width

options.isAlignedRight boolean
  • optional
  • default: false

Align rightward

options.hasResponsiveClose boolean
  • optional
  • default: false

Responsive close button

Public Members

public isAlignedRight: boolean source

Align rightward

public isFixed: boolean source

If the node has fixed full-width in responsive