Results 1 to 4 of 4

Thread: Change history.back() animation from slide-left to slide-right

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3

    Default Change history.back() animation from slide-left to slide-right

    Hi! Beginner question:

    how do you change
    Code:
    history.back()
    's slide animation? I'm transitioning from a Login page to a "Register page with a back button" via routing and when I click the back button (calls on history.back() ) it does a slide-transition left instead of right where it came from.

    TIA.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    What is the code that handles the history route that goes back?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    3

    Default Reply

    Code:
    control: {
                'login #signup': {
                    tap: function(btn, e) {
                        //switch view via routing
                        this.redirectTo('index/register');
    
    
                        e.event && e.stopEvent();
                    }
                }
            },
            routes: {
                'index/:view': 'switchView'
            }

    then this is the switchView() function:

    Code:
    switchView: function(view) {
            //avoid setActiveItem from creating a new view
            var targetView = Ext.ComponentQuery.query(view)[0]; 
    
    
            //checks availability of the view
            if (targetView === undefined) {
                var device = (Ext.os.is.Phone ? 'phone' : 'tablet');
                targetView = Ext.create('SenchaCordova.view.' + device + '.' + Ext.String.capitalize(view)); //create the view
            }
    
    
            //animate to view
            Ext.Viewport.animateActiveItem(targetView, { type : 'slide', direction : 'left' } );
        }

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    Only way to control the direction is to change the direction config in the animateActiveItem call.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •