mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-05 13:21:10 -05:00
31 lines
680 B
CoffeeScript
31 lines
680 B
CoffeeScript
|
ModalView = require '../kinds/ModalView'
|
||
|
template = require 'templates/modal/confirm'
|
||
|
|
||
|
module.exports = class ConfirmModal extends ModalView
|
||
|
id: "confirm-modal"
|
||
|
template: template
|
||
|
closeButton: true
|
||
|
closeOnConfirm: true
|
||
|
|
||
|
events:
|
||
|
'click #decline-button': 'doDecline'
|
||
|
'click #confirm-button': 'doConfirm'
|
||
|
|
||
|
constructor: (@renderData={}, options={}) ->
|
||
|
super(options)
|
||
|
|
||
|
getRenderData: ->
|
||
|
context = super()
|
||
|
context.closeOnConfirm = @closeOnConfirm
|
||
|
_.extend context, @renderData
|
||
|
|
||
|
setRenderData: (@renderData) ->
|
||
|
|
||
|
onDecline: (@decline) ->
|
||
|
|
||
|
onConfirm: (@confirm) ->
|
||
|
|
||
|
doConfirm: -> @confirm() if @confirm
|
||
|
|
||
|
doDecline: -> @decline() if @decline
|