Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Supports Animating Ember Mixin for use with gigafied's ember-animate
;(function ($, Em, global, undefined) {
var App = global.App;
var rAF = global.Modernizr.prefixed('requestAnimationFrame', window) || function (cb) {
global.setTimeout(cb, 1000 / 60);
};
App.SupportsAnimationMixin = Em.Mixin.create({
classNames: ['supports-animation'],
classBindings: ['animatingIn:is-animating-in', 'animatingOut:is-animating-out'],
animatingIn: false,
animatingOut: false,
__step: function (ts) {
},
willAnimateIn: function () {
var $view = this.$();
},
animateIn: function (next) {
var $view = this.$();
this.set('animatingIn', true);
},
didAnimateIn: function () {
var $view = this.$();
this.set('animatingIn', false);
},
willAnimateOut: function () {
var $view = this.$();
},
animateOut: function (next) {
var $view = this.$();
this.set('animatingOut', true);
},
didAnimateOut: function () {
var $view = this.$();
this.set('animatingOut', false);
}
});
})(jQuery, Em, window, undefined);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment