diff options
author | jessib <jessib@leap.se> | 2013-07-11 11:41:06 -0700 |
---|---|---|
committer | jessib <jessib@leap.se> | 2013-07-11 11:41:06 -0700 |
commit | 047d6c002abfb498f20c09cf318fc4a10901837f (patch) | |
tree | ba8e2c34bcd9ccc8f534d52488568a7b4d6a658b /users/app | |
parent | cc83a756affe1cedd6d828f038632b36e8afe95c (diff) |
Clear authentication errors before displaying new ones.
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/assets/javascripts/users.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/users/app/assets/javascripts/users.js b/users/app/assets/javascripts/users.js index 4195df8..2eb644b 100644 --- a/users/app/assets/javascripts/users.js +++ b/users/app/assets/javascripts/users.js @@ -3,7 +3,7 @@ // LOCAL FUNCTIONS // - var poll_users, prevent_default, form_failed, form_passed; + var poll_users, prevent_default, form_failed, form_passed, clear_errors; prevent_default = function(event) { return event.preventDefault(); @@ -15,6 +15,11 @@ }).done(process); }; + clear_errors = function() { + return $('#messages').empty(); + }; + + // // PUBLIC FUNCTIONS // @@ -38,6 +43,7 @@ // decorates the appropriate fields with the error messages. // srp.error = function(message) { + clear_errors(); var element, error, field; if ($.isPlainObject(message) && message.errors) { for (field in message.errors) { |