animate I say!

This commit is contained in:
Keivan Beigi 2013-05-14 19:07:14 -07:00
commit 5928ffc693
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,20 @@
"use strict";
(function () {
var _originalRegionClose = Marionette.Region.prototype.close;
Marionette.Region.prototype.open = function (view) {
var self = this;
this.$el.fadeOut(200, function () {
_originalRegionClose.apply(this, arguments);
self.$el.html(view.el);
self.$el.fadeIn(150);
});
};
Marionette.Region.prototype.close = function () {
//do nothing. we close the region as part of open so we can chain the animation
};
}());