File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " backbone.viewstack" ,
3- "version" : " 1.0.12 " ,
3+ "version" : " 1.0.13 " ,
44 "homepage" : " https://github.com/vash15/backbone.viewstack" ,
55 "authors" : [
66 " Michele Belluco <michele@belluco.info>" ,
Original file line number Diff line number Diff line change @@ -149,11 +149,24 @@ var ViewStack = module.exports = Backbone.View.extend({
149149
150150 self . _popView ( poppedView , false ) ;
151151
152- poppedView . $el . one ( 'webkitAnimationEnd mozAnimationEnd msAnimationEnd animationend' , function ( e ) {
153- poppedView . trigger ( 'pop' ) ;
154- poppedView . destroy ( ) ;
155- poppedView . trigger ( "deactive" ) ;
156- } ) ;
152+ if ( ! options . animatedName ) {
153+ poppedView . $el . one ( 'webkitAnimationEnd mozAnimationEnd msAnimationEnd animationend' , function ( e ) {
154+ poppedView . trigger ( 'pop' ) ;
155+ poppedView . destroy ( ) ;
156+ poppedView . trigger ( "deactive" ) ;
157+ } ) ;
158+ } else {
159+ // Viene usata nei casi di più animazioni nella view. Cos' mi assicuro di distruggerla solo dopo aver
160+ // terminato l'animazione desiderata
161+ poppedView . $el . on ( 'webkitAnimationEnd mozAnimationEnd msAnimationEnd animationend' , function ( e ) {
162+ if ( e && e . originalEvent && e . originalEvent . animationName == options . animatedName ) {
163+ poppedView . $el . off ( 'webkitAnimationEnd mozAnimationEnd msAnimationEnd animationend' ) ;
164+ poppedView . trigger ( 'pop' ) ;
165+ poppedView . destroy ( ) ;
166+ poppedView . trigger ( "deactive" ) ;
167+ }
168+ } ) ;
169+ }
157170 poppedView . $el . addClass ( 'pop' ) ;
158171
159172 return poppedView ;
You can’t perform that action at this time.
0 commit comments