summaryrefslogtreecommitdiff
path: root/AlertModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'AlertModal.js')
-rw-r--r--AlertModal.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/AlertModal.js b/AlertModal.js
new file mode 100644
index 0000000..77bd67d
--- /dev/null
+++ b/AlertModal.js
@@ -0,0 +1,26 @@
+
+
+var AlertModal = new( ModalFormView.extend({
+ el: ".mediaDrawer.alert",
+
+ events: {
+ "click .ok": "advance",
+ "click .close": "advance",
+ },
+
+ alert: function(message, callback){
+ this.$(".message").empty().append(message)
+ this.callback = callback
+ this.show()
+ this.$(".ok").focus()
+ },
+
+ advance: function(e){
+ e && e.preventDefault()
+ this.hide()
+ this.callback && this.callback()
+ this.callback = null
+ }
+
+}))
+