Skip to content

Commit

Permalink
fix(js): clear system messages when submitting ajax submitted form
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Apr 1, 2019
1 parent ac818d3 commit dbc6a91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions views/default/core/js/elgglib.js
Expand Up @@ -367,6 +367,13 @@ elgg.system_messages = function(msgs, delay, type) {
}
};

/**
* Helper function to remove all current system messages
*/
elgg.clear_system_messages = function() {
$('ul.elgg-system-messages').empty();
};

/**
* Wrapper function for system_messages. Specifies "messages" as the type of message
* @param {String} msgs The message to display
Expand Down
1 change: 1 addition & 0 deletions views/default/input/form.js
Expand Up @@ -12,6 +12,7 @@ define(function (require) {
data: ajax.objectify($form),
beforeSend: function() {
$form.find('[type="submit"]').prop('disabled', true);
elgg.clear_system_messages();
}
}).done(function (json, status, jqXHR) {
if (jqXHR.AjaxData.status === -1) {
Expand Down

0 comments on commit dbc6a91

Please sign in to comment.