Home Reference Source
public class | source

AbstractPage

Extends:

AbstractService → AbstractPage

Direct Subclass:

DefaultPage

Base class for creating page implementations.

Do not instanciate this class directly, create a sub-class.

Constructor Summary

Public Constructor
public

Base constructor for Pages.

Member Summary

Public Members
public
public

HTMLElement blocks collection.

public
public

AbstractBlock collection.

public

Page context (static or ajax)

public
public

Page id

public

Is home ?

public

Meta title

public

Node name

public
public

rootElement: HTMLElement

Container element

public

Page type

Method Summary

Public Methods
public

Destroy current page and all its blocks.

public

Destroy events

public

Get a page block instance from its id.

public

Get a page block index from its id.

public

Get the first page block instance from its type.

public

Get the first page block index from its type.

public

async init()

Initialize page.

public

async initBlocks()

Initialize page blocks on page.

public

Initialize basic events.

public

async initSingleBlock(blockElement: HTMLElement): AbstractBlock

public abstract
public

async updateBlocks()

Append new blocks which were not present at init.

Inherited Summary

From class AbstractService
public
public
public

checkDependencies(dependencies: *[])

public

getService(serviceName: *): *

public

hasService(serviceName: *): *

public

init()

Public Constructors

public constructor() source

Base constructor for Pages.

Override:

AbstractService#constructor

Public Members

public bindedUpdateBlocks: * source

public blockElements: Array source

HTMLElement blocks collection.

public blockLength: Number source

public blocks: Array<AbstractBlock> source

AbstractBlock collection.

public context: String | null source

Page context (static or ajax)

public domObserver: * source

public id: String | null source

Page id

public isHome: boolean source

Is home ?

public metaTitle: String | null source

Meta title

public name: String | null source

Node name

public onResizeDebounce: * source

public rootElement: HTMLElement source

Container element

public type: String | null source

Page type

Public Methods

public destroy() source

Destroy current page and all its blocks.

public destroyEvents() source

Destroy events

public getBlockById(id: String): AbstractBlock | null source

Get a page block instance from its id.

Params:

NameTypeAttributeDescription
id String

Return:

AbstractBlock | null

public getBlockIndexById(id: String): * | null source

Get a page block index from its id.

Params:

NameTypeAttributeDescription
id String

Return:

* | null

public getFirstBlockByType(type: String): AbstractBlock | null source

Get the first page block instance from its type.

Params:

NameTypeAttributeDescription
type String

Return:

AbstractBlock | null

public getFirstBlockIndexByType(type: String): * | null source

Get the first page block index from its type.

Params:

NameTypeAttributeDescription
type String

Return:

* | null

public async init() source

Initialize page.

You should always extends this method in your child implementations instead of extending page constructor.

Override:

AbstractService#init

public async initBlocks() source

Initialize page blocks on page.

public initEvents() source

Initialize basic events.

public async initSingleBlock(blockElement: HTMLElement): AbstractBlock source

Params:

NameTypeAttributeDescription
blockElement HTMLElement

Return:

AbstractBlock

public abstract onResize() source

public async updateBlocks() source

Append new blocks which were not present at init.