mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Ameliorated #468, maybe. At least, it doesn't erroneously show the name errors any more.
This commit is contained in:
parent
b7f3d5310e
commit
a792286161
1 changed files with 4 additions and 3 deletions
|
@ -22,6 +22,7 @@ module.exports = class WizardSettingsModal extends View
|
|||
WizardSettingsView = require 'views/account/wizard_settings_view'
|
||||
view = new WizardSettingsView()
|
||||
@insertSubView view
|
||||
super()
|
||||
|
||||
checkNameExists: =>
|
||||
forms.clearFormAlerts(@$el)
|
||||
|
@ -31,7 +32,7 @@ module.exports = class WizardSettingsModal extends View
|
|||
forms.applyErrorsToForm(@$el, {property:'name', message:'is already taken'}) if id and id isnt me.id
|
||||
$.ajax("/db/user/#{name}/nameToID", {success: success})
|
||||
|
||||
onWizardSettingsDone: =>
|
||||
onWizardSettingsDone: ->
|
||||
me.set('name', $('#wizard-settings-name').val())
|
||||
forms.clearFormAlerts(@$el)
|
||||
res = me.validate()
|
||||
|
@ -46,6 +47,7 @@ module.exports = class WizardSettingsModal extends View
|
|||
|
||||
res.error =>
|
||||
errors = JSON.parse(res.responseText)
|
||||
console.warn "Got errors saving user:", errors
|
||||
forms.applyErrorsToForm(@$el, errors)
|
||||
@disableModalInProgress(@$el)
|
||||
|
||||
|
@ -53,4 +55,3 @@ module.exports = class WizardSettingsModal extends View
|
|||
@hide()
|
||||
|
||||
@enableModalInProgress(@$el)
|
||||
me.save()
|
||||
|
|
Loading…
Reference in a new issue