Created
February 8, 2013 23:26
-
-
Save juliomenendez/4742814 to your computer and use it in GitHub Desktop.
Backbone.Marionette.Region extended to animate changing its content.
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
var AnimatedRegion = Backbone.Marionette.Region.extend({ | |
show: function(view) { | |
var that = this; | |
this.ensureEl(); | |
this.close(); | |
view.on('close', function() { | |
that.$el.addClass('transparent'); }); | |
$.when(view.render()).then(function() { | |
that.open(view); | |
that.$el.removeClass('transparent'); | |
Marionette.triggerMethod.call(view, "show"); | |
Marionette.triggerMethod.call(that, "show", view); | |
}); | |
this.currentView = view; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment