Trigger manager : wait for page completion & listen change
Methods
static changeListener()
Wait for change
static doWhen(fnDo, fnWhen, fnStartopt, intervalopt, maxopt, count)
Execute a function When another function returns true
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
fnDo |
function | The function to execute |
||
fnWhen |
function | The function that must return true |
||
fnStart |
function |
<optional> |
if provided, must return true to start the monitoring |
|
interval |
number |
<optional> |
100 | The interval between two checks, in ms |
max |
number |
<optional> |
75 | Maximum number of checkings (default: 75) |
count |
number | Current checking, don't populate |
static force()
Force Triggering
static init(fnLoaded, fnChanged, fnReinit)
Initialization
Parameters:
Name | Type | Description |
---|---|---|
fnLoaded |
function | function returning true when page is loaded, then allowed to trigger page view. If null, always true. |
fnChanged |
function | function returning true when loaded page has been changed, then triggering again a page view. If null, only url change is observed |
fnReinit |
function | Reinitialisation function, executed before page view triggering after change. Must return true, otherwise tag is prevented. |
static loadListener()
Wait for page load
static pathChanged()
Says if triggered path has changed
true if path has changed
static urlChanged()
Says if triggered url has changed
true if url has changed