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:
|
2016-03-14 18:35:33 -04:00
|
|
|
'click #decline-button': 'onClickDecline'
|
|
|
|
'click #confirm-button': 'onClickConfirm'
|
2014-06-08 18:33:06 -04:00
|
|
|
|
2016-03-14 18:35:33 -04:00
|
|
|
initialize: (options) ->
|
|
|
|
_.assign @, _.pick(options, 'title', 'body', 'decline', 'confirm', 'closeOnConfirm', 'closeButton')
|
2014-06-08 18:33:06 -04:00
|
|
|
|
2016-03-14 18:35:33 -04:00
|
|
|
onClickDecline: -> @trigger 'decline'
|
2014-06-08 18:33:06 -04:00
|
|
|
|
2016-03-14 18:35:33 -04:00
|
|
|
onClickConfirm: -> @trigger 'confirm'
|