-
13 Feb 2012 6:13 AM #1
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'); },
-
13 Feb 2012 6:26 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Do you have any listeners or any other controllers that extend from this one?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Feb 2012 6:32 AM #3
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.
-
14 Feb 2012 2:01 AM #4
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.
-
22 Feb 2012 6:17 AM #5
quote.
same problem here with a card layout and these two animations:
every time I switch from one animation to the other the animation gets +1 round cycle of animations like this:Code:xt.getCmp('myagree').animateActiveItem(0, { type: 'slide', direction: 'right'}); ... xt.getCmp('myagree').animateActiveItem(1, { type: 'slide', direction: 'left'});
0 -> 1 -> 0 -><--> 1 -> 0 -><--><--> 1
and so on.
Marco
-
22 Feb 2012 6:18 AM #6
-
23 Feb 2012 5:53 AM #7


Reply With Quote