Created
July 8, 2014 11:48
-
-
Save rogeruiz/bc44b5d3f436665e663a to your computer and use it in GitHub Desktop.
Supports Animating Ember Mixin for use with gigafied's ember-animate
This file contains 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
;(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