2014-11-29 16:36:41 -05:00
|
|
|
ModalView = require '../../core/ModalView'
|
|
|
|
template = require 'templates/editor/modal/confirm-modal'
|
2014-06-08 18:33:06 -04:00
|
|
|
|
|
|
|
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'
|