summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib/AlertModal.js
blob: 1aeb048d8654b6d6027b21fea98b0a080f416eeb (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
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
	}

}))