var ConfirmModal = new( ModalFormView.extend({ el: ".mediaDrawer.confirm", events: { "click .yes": "agree", "click .no": "cancel", }, confirm: function(question, agreeCallback, cancelCallback){ this.$(".question").empty().append(question) this.agreeCallback = agreeCallback this.cancelCallback = cancelCallback this.show() }, agree: function(e){ e && e.preventDefault() this.hide() this.agreeCallback && this.agreeCallback() this.agreeCallback = null this.cancelCallback = null }, cancel: function(e){ e && e.preventDefault() this.hide() this.cancelCallback && this.cancelCallback() this.agreeCallback = null this.cancelCallback = null } }) )