Y.mojito.Client Class
The starting point for mojito to run in the browser. You can access one instance of the Mojito Client running within the browser environment through window.YMojito.client.
Item Index
Methods
attachBinders
-
binderMap -
parentId -
topLevelMojitViewId
Given a set of binder information, initialize binder instances and bind them to the page.
Parameters:
-
binderMapObjectviewId ==> binder data, contains all we need from the mojit dispatch's meta object about all the binders that were executed to create the DOM addition recently added to the document.
-
parentIdStringthe parent binder view id to attach any children.
-
topLevelMojitViewIdStringthe topmost (root) binder view id to attach as a child to the parent.
destroyMojitProxy
-
id -
retainNode
Parameters:
-
idStringThe mojit's viewId to destroy
-
retainNodeBoolean
executeAction
-
command -
viewId -
cb
Used for binders to execute their actions through the Mojito framework through their proxies.
Parameters:
-
commandObjectmust contain mojit id and action to execute.
-
viewIdStringthe view id of the current mojit, which is executing the action.
-
cbFunctioncallback to run when complete.
fireLifecycle
-
evt -
data
Fires a lifecycle event.
Parameters:
-
evtStringThe name of event to fire.
-
dataObjectThe data to pass to listeners.
pause
()
Pause the Mojito Client and all mojits that are running. This will notify all binders that they have been paused by calling their onPause() functions. It will prevent the immediate execution of several mojit proxy operations that might cause a long process to begin (especially things that might go to the server).
To resume, simply call .resume(). This will immediately execute all actions that occurred while Mojito was paused.
resume
()
Resumes the Mojito client after it has been paused (see method "pause"). If there are any queued actions that were executed and cached during the pause, calling resume() will immediately execute them. All binders are notified through their onResume() function that they are been resumed.
subscribe
-
evt -
cb
Subscribe to a MojitoClient lifecycle event.
Parameters:
-
evtStringname of event to subscribe to.
-
cbFunction(data)callback called when the event fires.
