dojox/app/controllers/Transition (version 1.10)

dojox/app/Controller

Usage

var foo = new Transition(app,events);
dojox/app/controllers/Transition
Parameter Type Description
app undefined

dojox/app application instance.

events undefined

{event : handler}

Property Summary

Method Summary

  • _addTransitionEventToWaitingQueue(transitionEvt)
  • _doTransition(transitionTo,opts,params,data,parent,removeView,doResize,forceTransitionNone,nested) Transitions from the currently visible view to the defined view.
  • _getCurrentSubViewArray(parent,nextSubViewArray,removeView) Get current sub view array which will be replaced by the views in the nextSubViewArray
  • _getNamesFromArray(subViewArray,backward) Get names from the sub view names array
  • _getNextSubViewArray(subIds,next,parent) Get next sub view array, this array will hold the views which are about to be transitioned to
  • _getParamsForView(view,params) Get view's params only include view specific params if they are for this view.
  • _getTransition(nextView,parent,transitionTo,opts,forceTransitionNone) Get view's transition type from the config for the view or from the parent view recursively.
  • _handleAfterActivateCalls(subs,removeView,current,data,subIds) Call afterActivate for each of the next views which have been activated
  • _handleAfterDeactivateCalls(subs,next,current,data,subIds) Call afterDeactivate for each of the current views which have been deactivated
  • _handleBeforeActivateCalls(subs,current,data,subIds) Call beforeActivate for each of the next views about to be activated
  • _handleBeforeDeactivateCalls(subs,next,current,data,subIds) Call beforeDeactivate for each of the current views which are about to be deactivated
  • _handleLayoutAndResizeCalls(subs,removeView,doResize,subIds,forceTransitionNone,transition) fire app-layoutView for each of the next views about to be activated, and fire app-resize if doResize is true
  • _handleMatchingViews(subs,next,current,parent,data,removeView,doResize,subIds,currentSubNames,toId,forceTransitionNone,opts) Called when the current views and the next views match
  • _handleTransit(next,parent,currentLastSubChild,opts,toId,removeView,forceTransitionNone,resizeDone) Setup the options and call transit to do the transition
  • _setViewVisible(v,visible)
  • _showSelectedChildren(w)
  • bind(evented,event,handler) Bind event on dojo/Evented instance, document, domNode or window.
  • proceedTransition(transitionEvt) Proceed transition queue by FIFO by default.
  • transition(event) Response to dojox/app "app-transition" event.
  • unbind(evented,event) remove a binded event signal.

Event Summary

Properties

proceeding
waitingQueue

Methods

_addTransitionEventToWaitingQueue(transitionEvt)
Parameter Type Description
transitionEvt undefined
_doTransition(transitionTo,opts,params,data,parent,removeView,doResize,forceTransitionNone,nested)

Transitions from the currently visible view to the defined view. It should determine what would be the best transition unless an override in opts tells it to use a specific transitioning methodology the transitionTo is a string in the form of [view1,view2].

Parameter Type Description
transitionTo Object

transition to view id. It looks like #tabView,tab1

opts Object

transition options

params Object

params

data Object

data object that will be passed on activate & de-activate methods of the view

parent Object

view's parent

removeView Boolean

remove the view instead of transition to it

doResize Boolean

emit a resize event

forceTransitionNone Boolean

force the transition type to be none, used for the initial default view

nested Boolean

whether the method is called from the transitioning of a parent view

Returns:any

transit dojo/promise/all object.

_getCurrentSubViewArray(parent,nextSubViewArray,removeView)

Get current sub view array which will be replaced by the views in the nextSubViewArray

Parameter Type Description
parent String

the parent view whose selected children will be replaced

nextSubViewArray Array

the array of views which are to be transitioned to.

removeView undefined
Returns:any | undefined

Array of views which will be deactivated during this transition

_getNamesFromArray(subViewArray,backward)

Get names from the sub view names array

Parameter Type Description
subViewArray Array

the array of views to get the names from.

backward boolean

the direction to loop thru the array to get the names.

Returns:any | undefined

String of view names separated by a comma

_getNextSubViewArray(subIds,next,parent)

Get next sub view array, this array will hold the views which are about to be transitioned to

Parameter Type Description
subIds String

the subids, the views are separated with a comma

next Object

the next view to be transitioned to.

parent Object

the parent view used in place of next if next is not set.

Returns:any | Array

Array of views which will be transitioned to during this transition

_getParamsForView(view,params)

Get view's params only include view specific params if they are for this view.

Parameter Type Description
view String

the view's name

params Object

the params

Returns:any | object

params Object for this view

_getTransition(nextView,parent,transitionTo,opts,forceTransitionNone)

Get view's transition type from the config for the view or from the parent view recursively. If not available use the transition option otherwise get view default transition type in the config from parent view.

Parameter Type Description
nextView undefined
parent Object

view's parent

transitionTo Object

view to transition to opts: Object transition options

opts undefined
forceTransitionNone boolean

true if the transition type should be forced to none, used for the initial defaultView

Returns:any | string

transition type like "slide", "fade", "flip" or "none".

_handleAfterActivateCalls(subs,removeView,current,data,subIds)

Call afterActivate for each of the next views which have been activated

Parameter Type Description
subs undefined
removeView undefined
current undefined
data undefined
subIds undefined
_handleAfterDeactivateCalls(subs,next,current,data,subIds)

Call afterDeactivate for each of the current views which have been deactivated

Parameter Type Description
subs undefined
next undefined
current undefined
data undefined
subIds undefined
_handleBeforeActivateCalls(subs,current,data,subIds)

Call beforeActivate for each of the next views about to be activated

Parameter Type Description
subs undefined
current undefined
data undefined
subIds undefined
_handleBeforeDeactivateCalls(subs,next,current,data,subIds)

Call beforeDeactivate for each of the current views which are about to be deactivated

Parameter Type Description
subs undefined
next undefined
current undefined
data parent,
subIds removeView, doResize,
_handleLayoutAndResizeCalls(subs,removeView,doResize,subIds,forceTransitionNone,transition)

fire app-layoutView for each of the next views about to be activated, and fire app-resize if doResize is true

Parameter Type Description
subs undefined
removeView undefined
doResize undefined
subIds undefined
forceTransitionNone undefined
transition undefined
_handleMatchingViews(subs,next,current,parent,data,removeView,doResize,subIds,currentSubNames,toId,forceTransitionNone,opts)

Called when the current views and the next views match

Parameter Type Description
subs undefined
next undefined
current undefined
parent undefined
data undefined
removeView undefined
doResize undefined
subIds undefined
currentSubNames undefined
toId undefined
forceTransitionNone undefined
opts undefined
_handleTransit(next,parent,currentLastSubChild,opts,toId,removeView,forceTransitionNone,resizeDone)

Setup the options and call transit to do the transition

Parameter Type Description
next Object

the next view, the view which will be transitioned to

parent Object

the parent view which is used to get the transition type to be used

currentLastSubChild Object

the current view which is being transitioned away from

opts Object

the options used for the transition

toId String

the id of the view being transitioned to

removeView boolean

true if the view is being removed

forceTransitionNone boolean

true if the transition type should be forced to none, used for the initial defaultView

resizeDone boolean

true if resize was called before this transition

Returns:any | undefined

the promise returned by the call to transit

_setViewVisible(v,visible)
Parameter Type Description
v undefined
visible undefined
_showSelectedChildren(w)
Parameter Type Description
w undefined
bind(evented,event,handler)

Bind event on dojo/Evented instance, document, domNode or window. Save event signal in controller instance. If no parameter is provided automatically bind all events registered in controller events property.

Parameter Type Description
evented Object

dojo/Evented instance, document, domNode or window

event String

event

handler Function

event handler

Returns:function

Bind event on dojo/Evented instance, document, domNode or window. Save event signal in controller instance. If no parameter is provided automatically bind all events registered in controller events property.

proceedTransition(transitionEvt)

Proceed transition queue by FIFO by default. If transition is in proceeding, add the next transition to waiting queue.

Parameter Type Description
transitionEvt Object

"app-transition" event parameter. It should be like: {"viewId":viewId, "opts":opts}

transition(event)

Response to dojox/app "app-transition" event.

Parameter Type Description
event Object

"app-transition" event parameter. It should be like: {"viewId": viewId, "opts": opts}

Examples

Example 1

Use emit to trigger "app-transition" event, and this function will response to the event. For example:

this.app.emit("app-transition", {"viewId": viewId, "opts": opts});
unbind(evented,event)

remove a binded event signal.

Parameter Type Description
evented Object

dojo/Evented instance, document, domNode or window

event String

event

Returns:function

remove a binded event signal.

Events

onDomNodeChange(evt)
Parameter Type Description
evt undefined

Examples

Example 1

Use emit to trigger "app-transition" event, and this function will response to the event. For example:

this.app.emit("app-transition", {"viewId": viewId, "opts": opts});
onStartTransition(evt)

Response to dojox/app "startTransition" event.

Parameter Type Description
evt Object

transition options parameter

Examples

Example 1

Use "dojox/mobile/TransitionEvent" to trigger "startTransition" event, and this function will response the event. For example:

var transOpts = {
    title:"List",
    target:"items,list",
    url: "#items,list",
    data: {}
};
new TransitionEvent(domNode, transOpts, e).dispatch();
Error in the documentation? Can’t find what you are looking for? Let us know!