Skip to content

Instantly share code, notes, and snippets.

@davidvanleeuwen
Created April 28, 2013 21:57
Show Gist options
  • Save davidvanleeuwen/5478570 to your computer and use it in GitHub Desktop.
Save davidvanleeuwen/5478570 to your computer and use it in GitHub Desktop.
jQuery(function($) {
// create a modal view class
var Modal = Backbone.Modal.extend({
template: _.template($('#modal-template').html()),
viewContainer: '.modal-view',
views: {
'click #first': {
view: _.template($('#modal-view1-template').html())
},
'click #second': {
view: _.template($('#modal-view2-template').html())
}
}
});
// render an instance of your modal
var modalView = new Modal;
$('body').append(modalView.render().el);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment