Skip to content

Commit

Permalink
Merge branch '5.0/prevent-ticket-double-click' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Oct 20, 2023
2 parents 6c00e40 + 9f85120 commit 65fe41e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions share/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,22 @@ jQuery(function() {
);
return false;
});

// Submit all forms only once.
// This stops all forms of double-clicking or double
// enter/return key.
jQuery('form').each(function() {
var form = jQuery(this);
form.on('submit', function (e) {
// Prevent if already submitting
if (form.hasClass('rt-form-submitted')) {
e.preventDefault();
}

// Add class to hook our visual indicator on
form.addClass('rt-form-submitted');
});
});
});

function filterSearchResults () {
Expand Down

0 comments on commit 65fe41e

Please sign in to comment.