From a6f58439c639e0bb390180f67675e87b6a3ece21 Mon Sep 17 00:00:00 2001 From: yo mama Date: Tue, 2 Dec 2014 15:39:57 -0800 Subject: first --- ConfirmModal.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ConfirmModal.js (limited to 'ConfirmModal.js') diff --git a/ConfirmModal.js b/ConfirmModal.js new file mode 100644 index 0000000..4b690de --- /dev/null +++ b/ConfirmModal.js @@ -0,0 +1,24 @@ + + +var ConfirmModal = new( ModalFormView.extend({ + el: ".mediaDrawer.confirm", + + events: { + "click .yes": "advance", + "click .no": "hide", + }, + + confirm: function(question, callback){ + this.$(".question").empty().append(question) + this.callback = callback + this.show() + }, + + advance: function(e){ + e && e.preventDefault() + this.hide() + this.callback && this.callback() + this.callback = null + } + +}) ) -- cgit v1.2.3-70-g09d2