Skip to content

Instantly share code, notes, and snippets.

@rogeruiz
Created July 8, 2014 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeruiz/bc44b5d3f436665e663a to your computer and use it in GitHub Desktop.
Save rogeruiz/bc44b5d3f436665e663a to your computer and use it in GitHub Desktop.
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