mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
fixes codecombat/codecombat#655 completely
Removes asynchronous name checking, though, if it ever worked.
This commit is contained in:
parent
459a1f9e48
commit
0dee3d042f
1 changed files with 2 additions and 11 deletions
|
@ -11,7 +11,6 @@ module.exports = class WizardSettingsModal extends View
|
|||
closesOnClickOutside: false
|
||||
|
||||
events:
|
||||
'change #wizard-settings-name': 'onNameChange'
|
||||
'click #wizard-settings-done': 'onWizardSettingsDone'
|
||||
|
||||
afterRender: ->
|
||||
|
@ -19,15 +18,6 @@ module.exports = class WizardSettingsModal extends View
|
|||
view = new WizardSettingsView()
|
||||
@insertSubView view
|
||||
|
||||
onNameChange: ->
|
||||
me.set('name', $('#wizard-settings-name').val())
|
||||
@checkNameExists()
|
||||
|
||||
checkNameExists: ->
|
||||
forms.clearFormAlerts(@$el)
|
||||
success = (id) => forms.applyErrorsToForm(@$el, {property:'name', message:'is already taken'}) if id and id isnt me.id
|
||||
$.ajax("/db/user/#{me.get('name')}/nameToID", {success: success})
|
||||
|
||||
onWizardSettingsDone: ->
|
||||
me.set('name', $('#wizard-settings-name').val())
|
||||
forms.clearFormAlerts(@$el)
|
||||
|
@ -45,8 +35,9 @@ module.exports = class WizardSettingsModal extends View
|
|||
errors = JSON.parse(res.responseText)
|
||||
forms.applyErrorsToForm(@$el, errors)
|
||||
@disableModalInProgress(@$el)
|
||||
|
||||
res.success (model, response, options) =>
|
||||
@hide()
|
||||
|
||||
@enableModalInProgress(@$el)
|
||||
me.save()
|
||||
me.save()
|
||||
|
|
Loading…
Reference in a new issue