summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanchandavishal <manchandavishal143@gmail.com>2023-04-11 00:12:52 +0530
committermanchandavishal <manchandavishal143@gmail.com>2023-04-11 00:12:52 +0530
commitcf158a213a03473d3df25123a075bdeca847db38 (patch)
tree6b94be4464d87b09a989dc1f52e49bf1d4bc6507
parent7d44796eca10fa61d4d98ab98358c5932746734e (diff)
downloadhorizon-cf158a213a03473d3df25123a075bdeca847db38.tar.gz
Fix "jQuery.fn.submit() event shorthand is deprecated" warning
In horizon.forms.handle_submit(), replaced the shorthand .submit() eventbinding with .on('submit', function ()) to avoid the deprecated shorthand usage as suggested by the jQuery documentation[1]. [1] https://api.jquery.com/submit/ Change-Id: I1ddd89bd99510a981f2f3b6e198786890be22280
-rw-r--r--horizon/static/horizon/js/horizon.forms.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js
index 8fff1d0f5..cacfb46d8 100644
--- a/horizon/static/horizon/js/horizon.forms.js
+++ b/horizon/static/horizon/js/horizon.forms.js
@@ -184,12 +184,12 @@ horizon.forms = {
horizon.forms.handle_submit = function (el) {
var $form = $(el).find("form");
- $form.submit(function () {
+ $form.on('submit', function () {
var $this = $(this);
// Disable multiple submissions when launching a form.
var button = $this.find('[type="submit"]');
if (button.hasClass('btn-primary') && !button.hasClass('always-enabled')){
- $this.submit(function () {
+ $this.on('submit', function () {
return false;
});
button.removeClass('primary').addClass('disabled');