codecombat/app/views/modal/DiplomatSuggestionModal.coffee

19 lines
500 B
CoffeeScript
Raw Normal View History

2014-07-17 20:22:26 -04:00
ModalView = require 'views/kinds/ModalView'
2014-01-03 13:32:13 -05:00
template = require 'templates/modal/diplomat_suggestion'
2014-06-30 22:16:26 -04:00
{me} = require 'lib/auth'
forms = require 'lib/forms'
2014-01-03 13:32:13 -05:00
module.exports = class DiplomatSuggestionModal extends ModalView
2014-06-30 22:16:26 -04:00
id: 'diplomat-suggestion-modal'
2014-01-03 13:32:13 -05:00
template: template
events:
2014-06-30 22:16:26 -04:00
'click #subscribe-button': 'subscribeAsDiplomat'
2014-01-03 13:32:13 -05:00
subscribeAsDiplomat: ->
me.setEmailSubscription 'diplomatNews', true
2014-06-11 16:16:17 -04:00
me.patch()
2014-06-30 22:16:26 -04:00
$('#email_translator').prop('checked', 1)
2014-01-03 13:32:13 -05:00
@hide()
return