mediator

App. mediator

Methods

(static) getCurrentPage() → {Object}

Get the currentPage object
Source:
Returns:
Type:
Object
PageObject

(static) getCurrentUrl() → {string}

Get the current url string
Source:
Returns:
Type:
string
The current url

(static) getPreviousPage() → {Object}

Get the previousPage object
Source:
Returns:
Type:
Object
PageObject

(static) getPreviousUrl() → {string}

Get the previous url string
Source:
Returns:
Type:
string
The previous url

(static) goto(obj, previousPoppedUrl)

Change the current page to the requested route Do nothing if the current page is already the requested route
Source:
This:
Parameters:
Name Type Description
obj String Page requested
previousPoppedUrl String Url
Fires:

(static) init(page)

Properly sets the current page on first load
Source:
Parameters:
Name Type Description
page Object the loaded and inited page object
Fires:

(static) notify(key, data, cb)

Resolves and execute the action on the page and all modules
Source:
See:
  • AER in http://addyosmani.com/largescalejavascript/
This:
  • Mediator
Parameters:
Name Type Description
key String Notify key
data Object Bag of data
cb function Callback executed after each App.actions.execute execution
Returns:
this

(static) notifyCurrentPage(key, data, cb)

Resolves and executes the action on the page
Source:
This:
  • {Object}
Parameters:
Name Type Description
key String Notify key
data Object Bag of data
cb function Callback executed after each App.actions.execute execution
Returns:
this

(static) toggle(route, fallback)

Open the wanted page, return to the precedent page if the requested on is already open or fallback to a default one
Source:
Parameters:
Name Type Description
route String Url
fallback String Url used for as a fallback
Fires:

App.mediator

Defines the App Mediator
Author:
  • Deux Huit Huit <https://deuxhuithuit.com>
License:
  • MIT
Source:

Methods

(static) getCurrentPage() → {Object}

Get the currentPage object
Source:
Returns:
Type:
Object
PageObject

(static) getCurrentUrl() → {string}

Get the current url string
Source:
Returns:
Type:
string
The current url

(static) getPreviousPage() → {Object}

Get the previousPage object
Source:
Returns:
Type:
Object
PageObject

(static) getPreviousUrl() → {string}

Get the previous url string
Source:
Returns:
Type:
string
The previous url

(static) goto(obj, previousPoppedUrl)

Change the current page to the requested route Do nothing if the current page is already the requested route
Source:
This:
Parameters:
Name Type Description
obj String Page requested
previousPoppedUrl String Url
Fires:

(static) init(page)

Properly sets the current page on first load
Source:
Parameters:
Name Type Description
page Object the loaded and inited page object
Fires:

(static) notify(key, data, cb)

Resolves and execute the action on the page and all modules
Source:
See:
  • AER in http://addyosmani.com/largescalejavascript/
This:
  • Mediator
Parameters:
Name Type Description
key String Notify key
data Object Bag of data
cb function Callback executed after each App.actions.execute execution
Returns:
this

(static) notifyCurrentPage(key, data, cb)

Resolves and executes the action on the page
Source:
This:
  • {Object}
Parameters:
Name Type Description
key String Notify key
data Object Bag of data
cb function Callback executed after each App.actions.execute execution
Returns:
this

(static) toggle(route, fallback)

Open the wanted page, return to the precedent page if the requested on is already open or fallback to a default one
Source:
Parameters:
Name Type Description
route String Url
fallback String Url used for as a fallback
Fires: