summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib/ConfirmModal.js
blob: 01720bb0a934f4fedbf560101a7123d602b08aa7 (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
	}

}) )