From 24047b5056681f9b71bcaea7d7ff8c8540824097 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Tue, 9 May 2023 15:40:29 +0530 Subject: [PATCH] Fix "jQuery.fn.click() event shorthand is deprecated" warning This patch changed the code to use the recommended 'on()' method instead of the deprecated shorthand event. For more information about this deprecation, please refer [1]. [1] https://api.jquery.com/click/ Change-Id: I4118a241a9e588ddac8cd1863979a7c83d6f98ff --- .../static/framework/widgets/table/hz-select-all.directive.js | 2 +- horizon/static/framework/widgets/table/hz-select.directive.js | 2 +- horizon/static/horizon/js/horizon.forms.js | 2 +- horizon/static/horizon/js/horizon.tables.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/horizon/static/framework/widgets/table/hz-select-all.directive.js b/horizon/static/framework/widgets/table/hz-select-all.directive.js index f4b9464b87..cb1a1ca521 100644 --- a/horizon/static/framework/widgets/table/hz-select-all.directive.js +++ b/horizon/static/framework/widgets/table/hz-select-all.directive.js @@ -83,7 +83,7 @@ var hzTableCtrl = ctrls[0]; var stTableCtrl = ctrls[1]; - element.click(clickHandler); + element.on('click', clickHandler); /* * watch the table state for changes diff --git a/horizon/static/framework/widgets/table/hz-select.directive.js b/horizon/static/framework/widgets/table/hz-select.directive.js index 5cac205adc..aba0272c39 100644 --- a/horizon/static/framework/widgets/table/hz-select.directive.js +++ b/horizon/static/framework/widgets/table/hz-select.directive.js @@ -55,7 +55,7 @@ //////////////////// function link(scope, element, attrs, hzTableCtrl) { - element.click(clickHandler); + element.on('click', clickHandler); // select or unselect row function clickHandler() { diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js index 27a7e9bd66..c7c9431fce 100644 --- a/horizon/static/horizon/js/horizon.forms.js +++ b/horizon/static/horizon/js/horizon.forms.js @@ -228,7 +228,7 @@ horizon.forms.add_password_fields_reveal_buttons = function (el) { $input.closest('div').addClass("has-feedback"); $('').addClass( "form-control-feedback fa fa-eye password-icon" - ).insertAfter($input).click(function () { + ).insertAfter($input).on('click', function () { var $icon = $(this); if ($input.attr('type') === 'password') { diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js index 7b8d996320..b8a3ee4c74 100644 --- a/horizon/static/horizon/js/horizon.tables.js +++ b/horizon/static/horizon/js/horizon.tables.js @@ -334,7 +334,7 @@ horizon.datatables.confirm = function(action) { modal.css('z-index', child_backdrop.css('z-index')+10); } - modal.find('.' + confirmCssClass).click(function () { + modal.find('.' + confirmCssClass).on('click', function () { var $form = $action.closest('form'); var el = document.createElement("input"); el.type = 'hidden';