mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Fixed #370
This commit is contained in:
parent
1f7cea4e54
commit
bbe5399a97
3 changed files with 12 additions and 11 deletions
|
@ -16,18 +16,18 @@ module.exports.genericFailure = (jqxhr) ->
|
|||
error = module.exports.parseServerError(jqxhr.responseText)
|
||||
message = error.message
|
||||
message = error.property + ' ' + message if error.property
|
||||
res = errorModalTemplate(
|
||||
status:jqxhr.status
|
||||
statusText:jqxhr.statusText
|
||||
message: message
|
||||
)
|
||||
console.warn(jqxhr.status, jqxhr.statusText, error)
|
||||
existingForm = $('.form-inline:visible:first')
|
||||
existingForm = $('.form:visible:first')
|
||||
if existingForm[0]
|
||||
missingErrors = applyErrorsToForm(existingForm, [error])
|
||||
for error in missingErrors
|
||||
existingForm.append($('<div class="alert"></div>').text(error.message))
|
||||
else
|
||||
res = errorModalTemplate(
|
||||
status:jqxhr.status
|
||||
statusText:jqxhr.statusText
|
||||
message: message
|
||||
)
|
||||
showErrorModal(res)
|
||||
|
||||
module.exports.backboneFailure = (model, jqxhr, options) ->
|
||||
|
|
|
@ -144,12 +144,14 @@ module.exports = class CocoView extends Backbone.View
|
|||
# Loading ModalViews
|
||||
|
||||
enableModalInProgress: (modal) ->
|
||||
$('> div', modal).hide()
|
||||
$('.wait', modal).show()
|
||||
el = modal.find('.modal-content')
|
||||
el.find('> div', modal).hide()
|
||||
el.find('.wait', modal).show()
|
||||
|
||||
disableModalInProgress: (modal) ->
|
||||
$('> div', modal).show()
|
||||
$('.wait', modal).hide()
|
||||
el = modal.find('.modal-content')
|
||||
el.find('> div', modal).show()
|
||||
el.find('.wait', modal).hide()
|
||||
|
||||
# Subscriptions
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ module.exports = class LoginModalView extends View
|
|||
loginAccount: (e) =>
|
||||
forms.clearFormAlerts(@$el)
|
||||
userObject = forms.formToObject @$el
|
||||
# res = validateUser(userObject)
|
||||
res = tv4.validateMultiple userObject, User.schema.attributes
|
||||
return forms.applyErrorsToForm(@$el, res.errors) unless res.valid
|
||||
@enableModalInProgress(@$el) # TODO: part of forms
|
||||
|
|
Loading…
Reference in a new issue