summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib/AlertModal.js
blob: a4bf24189a4c194fe7b4d42c94dfa618069cdc78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
  }

}))