jackbone.js
function (pageName, role) {
            var lastPageName     = this.currentPageName || '';
            var lastPageRole     = this.currentPageRole || '';
            this.currentPageName = pageName;
            this.currentPageRole = role;

            // Known transition, return it.
            if (_(this.transitions).has(lastPageName + '-->' + pageName)) {
                return this.transitions[lastPageName + '-->' + pageName];
            }

            // Use JQueryMobile default page transition.
            var transition = $.mobile.defaultPageTransition;

            // Except for dialogs.
            if ((role === 'dialog') || (lastPageRole === 'dialog')) {
                // Use JQueryMobile default dialog transition.
                transition = $.mobile.defaultDialogTransition;
            }

            // Save the transition
            this.transitions[lastPageName + '-->' + pageName] = {
                transition: transition,
                reverse: false
            };
            this.transitions[pageName + '-->' + lastPageName] = {
                transition: transition,
                reverse: true
            };

            // And return it.
            return { transition: transition, reverse: false };
        }
function (pageName, role) {
            var lastPageName     = this.currentPageName || '';
            var lastPageRole     = this.currentPageRole || '';
            this.currentPageName = pageName;
            this.currentPageRole = role;

            // Known transition, return it.
            if (_(this.transitions).has(lastPageName + '-->' + pageName)) {
                return this.transitions[lastPageName + '-->' + pageName];
            }

            // Use JQueryMobile default page transition.
            var transition = $.mobile.defaultPageTransition;

            // Except for dialogs.
            if ((role === 'dialog') || (lastPageRole === 'dialog')) {
                // Use JQueryMobile default dialog transition.
                transition = $.mobile.defaultDialogTransition;
            }

            // Save the transition
            this.transitions[lastPageName + '-->' + pageName] = {
                transition: transition,
                reverse: false
            };
            this.transitions[pageName + '-->' + lastPageName] = {
                transition: transition,
                reverse: true
            };

            // And return it.
            return { transition: transition, reverse: false };
        }
function ( pageName , role ) { var lastPageName = this . currentPageName || '' ; var lastPageRole = this . currentPageRole || '' ; this . currentPageName = pageName ; this . currentPageRole = role ; // Known transition, return it. if ( _ ( this . transitions ) . has ( lastPageName + '-->' + pageName ) ) { return this . transitions [ lastPageName + '-->' + pageName ] ; } // Use JQueryMobile default page transition. var transition = $ . mobile . defaultPageTransition ; // Except for dialogs. if ( ( role === 'dialog' ) || ( lastPageRole === 'dialog' ) ) { // Use JQueryMobile default dialog transition. transition = $ . mobile . defaultDialogTransition ; } // Save the transition this . transitions [ lastPageName + '-->' + pageName ] = { transition : transition , reverse : false } ; this . transitions [ pageName + '-->' + lastPageName ] = { transition : transition , reverse : true } ; // And return it. return { transition : transition , reverse : false } ; }
Return parameters of the transition to use to switch to pageName It's context dependant, meaning this method remembers the currently viewed view and determine the transition accordingly.
Return parameters of the transition to use to switch to pageName It s context dependant meaning this method remembers the currently viewed view and determine the transition accordingly .