// http://twitter.github.com/bootstrap/javascript.html#modals // http://lostechies.com/derickbailey/2012/04/17/managing-a-modal-dialog-with-backbone-and-marionette/ var ModalRegion = Marionette.Region.extend({ el : '#modal', onShow : function(view) { // 'hidden' - Bootstrap Modal event fired when the modal has finished being hidden from the user this.$el.on('hidden', this.close); view.on('close', this.hideModal, this); this.showModal(view); }, showModal : function(view) { this.$el.modal('show'); }, hideModal : function() { this.$el.modal('hide'); } }); // Region 선언 // - content // - modal App.addRegions({ content : '.content', modal : ModalRegion });