AbstractPage
Extends:
Direct Subclass:
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 |
domObserver: * |
|
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() Destroy current page and all its blocks. |
|
public |
Destroy events |
|
public |
getBlockById(id: String): AbstractBlock | null Get a page block instance from its |
|
public |
getBlockIndexById(id: String): * | null Get a page block index from its |
|
public |
getFirstBlockByType(type: String): AbstractBlock | null Get the first page block instance from its |
|
public |
getFirstBlockIndexByType(type: String): * | null Get the first page block index from its |
|
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 |
onResize() |
|
public |
async updateBlocks() Append new blocks which were not present at init. |
Inherited Summary
From class AbstractService | ||
public |
container: * |
|
public |
serviceName: * |
|
public |
checkDependencies(dependencies: *[]) |
|
public |
getService(serviceName: *): * |
|
public |
hasService(serviceName: *): * |
|
public |
init() |
Public Constructors
Public Members
public bindedUpdateBlocks: * source
public domObserver: * source
public onResizeDebounce: * source
Public Methods
public getBlockById(id: String): AbstractBlock | null source
Get a page block instance from its id
.
Params:
Name | Type | Attribute | Description |
id | String |
public getBlockIndexById(id: String): * | null source
Get a page block index from its id
.
Params:
Name | Type | Attribute | Description |
id | String |
public getFirstBlockByType(type: String): AbstractBlock | null source
Get the first page block instance from its type
.
Params:
Name | Type | Attribute | Description |
type | String |
public getFirstBlockIndexByType(type: String): * | null source
Get the first page block index from its type
.
Params:
Name | Type | Attribute | Description |
type | String |
public async init() source
Initialize page.
You should always extends this method in your child implementations instead of extending page constructor.
Override:
AbstractService#initpublic async initSingleBlock(blockElement: HTMLElement): AbstractBlock source
Params:
Name | Type | Attribute | Description |
blockElement | HTMLElement |