mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-24 14:32:24 -05:00
f47640e59a
Removed some unused styles, a template, a view and changed the class name of some views
31 lines
899 B
CoffeeScript
31 lines
899 B
CoffeeScript
ModalView = require 'views/core/ModalView'
|
|
template = require 'templates/play/modal/share-progress-modal'
|
|
storage = require 'core/storage'
|
|
|
|
module.exports = class ShareProgressModal extends ModalView
|
|
id: 'share-progress-modal'
|
|
template: template
|
|
plain: true
|
|
closesOnClickOutside: false
|
|
|
|
events:
|
|
'click .close-btn': 'hide'
|
|
'click .continue-link': 'hide'
|
|
'click .send-btn': 'onClickSend'
|
|
|
|
onClickSend: (e) ->
|
|
email = $('.email-input').val()
|
|
unless /[\w\.]+@\w+\.\w+/.test email
|
|
$('.email-input').parent().addClass('has-error')
|
|
$('.email-invalid').show()
|
|
return false
|
|
|
|
request = @supermodel.addRequestResource 'send_one_time_email', {
|
|
url: '/db/user/-/send_one_time_email'
|
|
data: {email: email, type: 'share progress modal parent'}
|
|
method: 'POST'
|
|
}, 0
|
|
request.load()
|
|
|
|
storage.save 'sent-parent-email', true
|
|
@hide()
|