Merge pull request #718 from ZmagoD/zd_SCI_1129_v3

Fixes error message [fixes SCI-1129]
This commit is contained in:
Zmago Devetak 2017-07-04 11:16:36 +02:00 committed by GitHub
commit 53a1dd14b7

View file

@ -76,7 +76,14 @@
Comments.initialize();
initNewResultAsset();
}).on('ajax:error', function(e, xhr) {
$form.renderFormErrors('result', xhr.responseJSON, true, e);
var errors = xhr.responseJSON.errors;
var formInput = $form.find('#result_asset_attributes_file');
$('[data-status="error"]').remove();
$.each(errors, function(key, value) {
var message = '<span data-status="error" style="color: #a94442">';
message += value + '</span>';
formInput.after(message);
})
animateSpinner(null, false);
});
}