Skip to content

Instantly share code, notes, and snippets.

@krisselden
Created November 22, 2011 17:11
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 krisselden/1386232 to your computer and use it in GitHub Desktop.
Save krisselden/1386232 to your computer and use it in GitHub Desktop.
prepare animation
require('TransformJS');
require('jquery-easing');
Y$.DialogTransitions = SC.Mixin.create({
easing: 'easeInOutQuint',
prepareForDialogAnimateIn: function() {
return this.$().animate({
translateY: "+=" + Y$.viewport.height
}, 0);
},
dialogAnimateIn: function() {
var $dialog, windowHeight;
$dialog = this.$();
windowHeight = Y$.viewport.height;
return $dialog.animate({
translateY: "-=" + windowHeight
}, 350, this.easing);
},
dialogAnimateOut: function(callback) {
var $dialog, windowHeight;
$dialog = this.$();
windowHeight = Y$.viewport.height;
return $dialog.animate({
translateY: "+=" + windowHeight
}, 350, this.easing, callback);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment