summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-25 00:22:38 +0000
committerGerrit Code Review <review@openstack.org>2023-04-25 00:22:38 +0000
commit9607dfbba4746f7d493f00f6bbfc2c747b5579c3 (patch)
tree7859f05ceb6731286999767c1e806bf1e0db9040
parent49d8d0ce75dfc5e1a4d4662a5e1b6da3da2c22da (diff)
parent6b0aa201798cb0a893d1b9a1bcc1fa465f8b340f (diff)
downloadhorizon-9607dfbba4746f7d493f00f6bbfc2c747b5579c3.tar.gz
Merge "Update jQuery click event to remove deprecation warning"
-rw-r--r--horizon/static/horizon/js/horizon.messages.js2
-rw-r--r--openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js4
-rw-r--r--openstack_dashboard/static/js/horizon.flatnetworktopology.js14
-rw-r--r--openstack_dashboard/static/js/horizon.networktopology.js10
4 files changed, 15 insertions, 15 deletions
diff --git a/horizon/static/horizon/js/horizon.messages.js b/horizon/static/horizon/js/horizon.messages.js
index 94d654efe..049a94273 100644
--- a/horizon/static/horizon/js/horizon.messages.js
+++ b/horizon/static/horizon/js/horizon.messages.js
@@ -100,7 +100,7 @@ horizon.addInitFunction(function () {
});
// Dismiss alert messages when moving on to a new type of action.
- $('a.ajax-modal').click(function() {
+ $('a.ajax-modal').on('click', function() {
horizon.clearAllMessages();
});
diff --git a/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js b/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js
index f7abf562a..fc67dcc7c 100644
--- a/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js
+++ b/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js
@@ -43,7 +43,7 @@
function link(scope, element) {
//TODO(tqtran) Use angular, not jQuery
- $('a[href="#"]').click(function(e) {
+ $('a[href="#"]').on('click', function(e) {
e.preventDefault();
});
@@ -51,7 +51,7 @@
var $pre = $uibModal.find('pre');
var $button = $('<div id="source-button" class="btn btn-primary btn-xs"><span class="fa fa-code"></span></div>')
- .click(function(){
+ .on('click', function(){
var $parent = $(this).parent();
var $fragment = stripAngular($parent.clone());
diff --git a/openstack_dashboard/static/js/horizon.flatnetworktopology.js b/openstack_dashboard/static/js/horizon.flatnetworktopology.js
index 33d355b93..9bb271d1d 100644
--- a/openstack_dashboard/static/js/horizon.flatnetworktopology.js
+++ b/openstack_dashboard/static/js/horizon.flatnetworktopology.js
@@ -105,12 +105,12 @@ horizon.flat_network_topology = {
e.stopImmediatePropagation();
var vnc_window = window.open($(this).attr('href'), vnc_window, 'width=760,height=560');
self.delete_balloon();
- })
- .click(function(){
+ });
+ $(document).on('click', function(){
self.delete_balloon();
});
- $('.toggle-view > .btn').click(function(){
+ $('.toggle-view > .btn').on('click', function(){
self.draw_mode = $(this).data('value');
$('g.network').remove();
horizon.cookies.put('ntp_draw_mode',self.draw_mode);
@@ -621,20 +621,20 @@ horizon.flat_network_topology = {
'left': x + 'px'
}).show();
- $balloon.find('.delete-device').click(function(){
+ $balloon.find('.delete-device').on('click', function(){
var $this = $(this);
var delete_modal = horizon.datatables.confirm($this);
- delete_modal.find('.btn.btn-danger').click(function () {
+ delete_modal.find('.btn.btn-danger').on('click', function () {
$this.prop('disabled', true);
d3.select('#id_' + $this.data('device-id')).classed('loading',true);
self.delete_device($this.data('type'),$this.data('device-id'));
horizon.modals.spinner.modal('hide');
});
});
- $balloon.find('.delete-port').click(function(){
+ $balloon.find('.delete-port').on('click', function(){
var $this = $(this);
var delete_modal = horizon.datatables.confirm($this);
- delete_modal.find('.btn.btn-danger').click(function () {
+ delete_modal.find('.btn.btn-danger').on('click', function () {
$this.prop('disabled', true);
self.delete_port($this.data('router-id'),$this.data('port-id'),$this.data('network-id'));
horizon.modals.spinner.modal('hide');
diff --git a/openstack_dashboard/static/js/horizon.networktopology.js b/openstack_dashboard/static/js/horizon.networktopology.js
index c94da2953..02cba863d 100644
--- a/openstack_dashboard/static/js/horizon.networktopology.js
+++ b/openstack_dashboard/static/js/horizon.networktopology.js
@@ -142,7 +142,7 @@ horizon.network_topology = {
self.refresh_labels();
});
- angular.element('#center_topology').click(function() {
+ angular.element('#center_topology').on('click', function() {
this.blur(); // remove btn focus after click
self.delete_balloon();
// move visualization to the center and reset scale
@@ -1101,19 +1101,19 @@ horizon.network_topology = {
})
.addClass('leftPosition');
}
- _balloon.find('.delete-device').click(function() {
+ _balloon.find('.delete-device').on('click', function() {
var _this = angular.element(this);
var delete_modal = horizon.datatables.confirm(_this);
- delete_modal.find('.btn.btn-danger').click(function () {
+ delete_modal.find('.btn.btn-danger').on('click', function () {
_this.prop('disabled', true);
d3.select('#id_' + _this.data('device-id')).classed('loading',true);
self.delete_device(_this.data('type'),_this.data('device-id'));
});
});
- _balloon.find('.delete-port').click(function() {
+ _balloon.find('.delete-port').on('click', function() {
var _this = angular.element(this);
var delete_modal = horizon.datatables.confirm(_this);
- delete_modal.find('.btn.btn-danger').click(function () {
+ delete_modal.find('.btn.btn-danger').on('click', function () {
_this.prop('disabled', true);
self.delete_port(_this.data('router-id'),_this.data('port-id'),_this.data('network-id'));
});