diff options
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 + } + +}) ) |
