new History(viewer)
Browser history managment, add slug name of scenes in URL.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | The viewer reference. |
- Source:
Extends
Members
(static, constant) DEFAULT_CONFIG :HistoryConfig
Default configuration of the History
Type:
- HistoryConfig
- Source:
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
(readonly) enabled :boolean
Get the enbled flag value of the history.
Type:
- boolean
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
addConfig(config)
Add the history configuration.
Parameters:
Name | Type | Description |
---|---|---|
config |
HistoryConfig | The configuration to add |
- Source:
destroy()
Destroy sequence.
- Overrides:
- Source:
generateHash(scene, keepopt) → {string}
Generate a hash for the current scene with the i18n slug name and the scene uid.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
scene |
FORGE.Scene | Object | The scene for which you want to generate a hash. | ||
keep |
boolean |
<optional> |
true | Do we have to keep the existing URL parameters. |
- Source:
Returns:
The generated hash.
- Type
- string
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: