summaryrefslogtreecommitdiff
path: root/ConfirmModal.js
blob: 4b690deacab59d738a5ee31df82e2908e8bc34e7 (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
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
  }

}) )