2014-11-28 20:49:41 -05:00
|
|
|
ModalView = require '../core/ModalView'
|
2014-06-08 18:33:06 -04:00
|
|
|
template = require 'templates/modal/confirm'
|
|
|
|
|
|
|
|
module.exports = class ConfirmModal extends ModalView
|
2014-06-30 22:16:26 -04:00
|
|
|
id: 'confirm-modal'
|
2014-06-08 18:33:06 -04:00
|
|
|
template: template
|
|
|
|
closeButton: true
|
|
|
|
closeOnConfirm: true
|
|
|
|
|
|
|
|
events:
|
2014-08-08 11:14:57 -04:00
|
|
|
'click #decline-button': 'onDecline'
|
|
|
|
'click #confirm-button': 'onConfirm'
|
2014-06-08 18:33:06 -04:00
|
|
|
|
|
|
|
constructor: (@renderData={}, options={}) ->
|
|
|
|
super(options)
|
|
|
|
|
|
|
|
getRenderData: ->
|
|
|
|
context = super()
|
|
|
|
context.closeOnConfirm = @closeOnConfirm
|
|
|
|
_.extend context, @renderData
|
|
|
|
|
|
|
|
setRenderData: (@renderData) ->
|
|
|
|
|
2014-08-08 11:14:57 -04:00
|
|
|
onDecline: -> @trigger 'decline'
|
2014-06-08 18:33:06 -04:00
|
|
|
|
2014-08-08 11:14:57 -04:00
|
|
|
onConfirm: -> @trigger 'confirm'
|