1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
    jgadbois is on a distinguished road

      0  

    Default Unanswered: Animation happening multiple times

    Unanswered: Animation happening multiple times


    I'm new to Sencha and am just trying to toggle between a login and signup screen. I have the below controller. When I use the controls, then the animation between screens is happening, but it happens multiple times. Each time I push the button it happens one more time than the time before. I'm verifying that my Ext.create function is only getting called once for each view. Any ideas why this multiple animation is happening?

    Code:
    Ext.define('WT.controller.Sessions', {
      extend: 'Ext.app.Controller',
      config: {
        routes: {
          'login': 'showLogin',
          'signup': 'showSignup'
        },
        refs: {
          loginForm: 'formpanel',
          signupForm: '#signup',
        },
        control: {
            'button[text="Sign up!"]': {
                tap: 'redirectToSignup'
            },
            'button[text="back"]': {
                tap: 'redirectToLogin'
            },
            'button[text="Login"]': {
                tap: 'doLogin'
            }
    
    
        },
      },
    
    
      init: function() {
        this.loginView = null;
        this.signupView = null;
      },
    
    
      showLogin: function() {
        if(!this.loginView) {
          this.loginView = Ext.create('WT.view.Login', { id: 'login' })
          this.signupView = Ext.create('WT.view.Signup', { id: 'signup' })
          Ext.Viewport.animateActiveItem(this.loginView ,{ type: 'slide', direction: 'up'});
        } else {
          // show login form
          Ext.Viewport.animateActiveItem(this.loginView ,{ type: 'slide', direction: 'left'});
        }
      },
    
    
      showSignup: function() {
        // show signup form
        Ext.Viewport.animateActiveItem(this.signupView , {type: 'slide', direction: 'right'});
      },
    
    
      redirectToSignup: function() {
        this.redirectTo('signup');
      },
    
    
      redirectToLogin: function() {
        this.redirectTo('login');
      },

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,524
    Vote Rating
    873
    Answers
    3563
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Do you have any listeners or any other controllers that extend from this one?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
    jgadbois is on a distinguished road

      0  

    Default


    Thanks for the quick response.

    No, that is the only controller I have so far. The 2 view files being loaded are both just Ext.define calls that extend 'Ext.Panel'. My app.js doesn't reference those views at all.

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    9
    Vote Rating
    0
    clansman is on a distinguished road

      0  

    Default


    I have exacly the same problem. According to the documentation the animation should exist only for the duration of the item change. http://docs.sencha.com/touch/2-0/#!/...mateActiveItem the animation object is supposed to be destroyed. I checked my code plenty times and the example above seems to be even more transparent. Think the case here might be the animation not being destroyed but appended every time. to the said panel.

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    20
    Vote Rating
    0
    bassajen is on a distinguished road

      0  

    Default


    quote.

    same problem here with a card layout and these two animations:
    Code:
    xt.getCmp('myagree').animateActiveItem(0, { type: 'slide', direction: 'right'});
    ...
    xt.getCmp('myagree').animateActiveItem(1, { type: 'slide', direction: 'left'});
    every time I switch from one animation to the other the animation gets +1 round cycle of animations like this:

    0 -> 1 -> 0 -><--> 1 -> 0 -><--><--> 1

    and so on.

    Marco

  6. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
    jgadbois is on a distinguished road

      0  

    Default


    I'm still having the problem too.

  7. #7
    Sencha User
    Join Date
    Jul 2009
    Posts
    55
    Vote Rating
    0
    jgadbois is on a distinguished road

      0  

    Default


    This cleared up for me in RC1