-
-
Save zoghal/3209228 to your computer and use it in GitHub Desktop.
How to receive transitionEnd events on the view layer, which option is the most suitable?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = Em.Application.create({ | |
customEvents: { | |
webkitTransitionEnd: 'transitionEnd' | |
} | |
}); | |
Em.View.extend({ | |
transitionEnd: function(event) { | |
// write you APP logic. TransitionEnd will fire multiple times for each transitioned CSS property | |
}, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Em.View.extend({ | |
transitionEnd: function(event) { | |
// write you APP logic. TransitionEnd will fire multiple times for each transitioned CSS property | |
}, | |
didInsertElement: function() { | |
this._super(); | |
self.$().on('webkitTransitionEnd', function(event) { | |
self.transitionEnd(event); | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment