summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanchandavishal <manchandavishal143@gmail.com>2023-05-09 15:40:29 +0530
committermanchandavishal <manchandavishal143@gmail.com>2023-05-09 15:40:29 +0530
commit24047b5056681f9b71bcaea7d7ff8c8540824097 (patch)
treed56b9d3444fd0fb7f759e422b06bb65e24419e56
parent852d5dc7922abe0b9d2a3e26ed6ede9902a2da47 (diff)
downloadhorizon-24047b5056681f9b71bcaea7d7ff8c8540824097.tar.gz
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
-rw-r--r--horizon/static/framework/widgets/table/hz-select-all.directive.js2
-rw-r--r--horizon/static/framework/widgets/table/hz-select.directive.js2
-rw-r--r--horizon/static/horizon/js/horizon.forms.js2
-rw-r--r--horizon/static/horizon/js/horizon.tables.js2
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 f4b9464b8..cb1a1ca52 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 5cac205ad..aba0272c3 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 27a7e9bd6..c7c9431fc 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");
$('<span>').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 7b8d99632..b8a3ee4c7 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';