diff options
| author | yo mama <pepper@scannerjammer.com> | 2014-12-02 15:39:57 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2014-12-02 15:39:57 -0800 |
| commit | a6f58439c639e0bb390180f67675e87b6a3ece21 (patch) | |
| tree | e39a4564065b4dd41f46d6ec095e9989c72278f3 /ConfirmModal.js | |
first
Diffstat (limited to 'ConfirmModal.js')
| -rw-r--r-- | ConfirmModal.js | 24 |
1 files changed, 24 insertions, 0 deletions
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 + } + +}) ) |
