diff --git a/app/lib/errors.coffee b/app/lib/errors.coffee index f979d1e35..372507d0c 100644 --- a/app/lib/errors.coffee +++ b/app/lib/errors.coffee @@ -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($('
').text(error.message)) else + res = errorModalTemplate( + status:jqxhr.status + statusText:jqxhr.statusText + message: message + ) showErrorModal(res) module.exports.backboneFailure = (model, jqxhr, options) -> diff --git a/app/views/kinds/CocoView.coffee b/app/views/kinds/CocoView.coffee index 56c759a5b..117b8bc8f 100644 --- a/app/views/kinds/CocoView.coffee +++ b/app/views/kinds/CocoView.coffee @@ -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 diff --git a/app/views/modal/login_modal.coffee b/app/views/modal/login_modal.coffee index e53d1c3b9..26499bd62 100644 --- a/app/views/modal/login_modal.coffee +++ b/app/views/modal/login_modal.coffee @@ -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