summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-25 21:11:04 +0000
committerGerrit Code Review <review@openstack.org>2023-04-25 21:11:04 +0000
commit66fa187586fd4ffe475ddf71e1fb16b74f4ff1d7 (patch)
treeff043ea2bdf66e9d64f51b5c12ba902ae7e8b3f7
parentc151d67c93a5ea670eeaecf62c89bde1458f358e (diff)
parent43a792ec94bc3360da8bfbc118cca28cad03b128 (diff)
downloadhorizon-66fa187586fd4ffe475ddf71e1fb16b74f4ff1d7.tar.gz
Merge "Update deprecated jQuery functions"
-rw-r--r--horizon/static/framework/util/tech-debt/image-file-on-change.directive.js2
-rw-r--r--horizon/static/horizon/js/horizon.d3linechart.js2
-rw-r--r--horizon/static/horizon/js/horizon.hacks.js2
-rw-r--r--horizon/static/horizon/js/horizon.membership.js2
-rw-r--r--horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js2
-rw-r--r--openstack_dashboard/static/js/angular/directives/serialConsole.js2
6 files changed, 6 insertions, 6 deletions
diff --git a/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js b/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js
index e6df46c0c..64c46cb51 100644
--- a/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js
+++ b/horizon/static/framework/util/tech-debt/image-file-on-change.directive.js
@@ -29,7 +29,7 @@
return directive;
function link($scope, element, attrs, ngModel) {
- element.bind('change', function (event) {
+ element.on('change', function (event) {
var files = event.target.files;
var file = files[0];
ngModel.$setViewValue(file);
diff --git a/horizon/static/horizon/js/horizon.d3linechart.js b/horizon/static/horizon/js/horizon.d3linechart.js
index f01b81992..d2dba8202 100644
--- a/horizon/static/horizon/js/horizon.d3linechart.js
+++ b/horizon/static/horizon/js/horizon.d3linechart.js
@@ -755,7 +755,7 @@ horizon.d3_line_chart = {
* @param settings An object containing settings of the chart.
*/
var delegate_event_and_refresh_charts = function(selector, event_name, settings) {
- $('form').delegate(selector, event_name, function() {
+ $('form').on(selector, event_name, function() {
/*
Registering 'any event' on form element by delegating. This way it
can be easily overridden / enhanced when some special functionality
diff --git a/horizon/static/horizon/js/horizon.hacks.js b/horizon/static/horizon/js/horizon.hacks.js
index d1db9fa93..6df69894b 100644
--- a/horizon/static/horizon/js/horizon.hacks.js
+++ b/horizon/static/horizon/js/horizon.hacks.js
@@ -15,7 +15,7 @@
// Added so that we can break Firefox and Safari bfcache to
// prevent loading previous page from cache.
horizon.addInitFunction(function () {
- $(window).bind('pageshow', function(event) {
+ $(window).on('pageshow', function(event) {
if (event.originalEvent.persisted) {
window.location.reload();
}
diff --git a/horizon/static/horizon/js/horizon.membership.js b/horizon/static/horizon/js/horizon.membership.js
index 7ff62c4e3..4c3799b1f 100644
--- a/horizon/static/horizon/js/horizon.membership.js
+++ b/horizon/static/horizon/js/horizon.membership.js
@@ -415,7 +415,7 @@ horizon.membership = {
**/
list_filtering: function (step_slug) {
// remove previous lists' quicksearch events
- $('input.' + step_slug + '_filter').unbind();
+ $('input.' + step_slug + '_filter').off();
// set up quicksearch to filter on input
$('.' + step_slug + '_filterable').each(function () {
diff --git a/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js b/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js
index 9678b51f8..3978af5f3 100644
--- a/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js
+++ b/horizon/static/horizon/lib/jquery/jquery.bootstrap.wizard.js
@@ -38,7 +38,7 @@ var bootstrapWizardCreate = function(element, options) {
this.rebindClick = function(selector, fn)
{
- selector.unbind('click', fn).bind('click', fn);
+ selector.off('click', fn).bind('click', fn);
}
this.fixNavigationButtons = function() {
diff --git a/openstack_dashboard/static/js/angular/directives/serialConsole.js b/openstack_dashboard/static/js/angular/directives/serialConsole.js
index df48e6b89..97a691038 100644
--- a/openstack_dashboard/static/js/angular/directives/serialConsole.js
+++ b/openstack_dashboard/static/js/angular/directives/serialConsole.js
@@ -77,7 +77,7 @@ limitations under the License.
scope.cols = 80;
scope.rows = 24;
// event handler to resize console according to window resize.
- angular.element(window).bind('resize', resizeTerminal);
+ angular.element(window).on('resize', resizeTerminal);
function resizeTerminal() {
var terminal = angular.element('.terminal')[0];
// take margin for scroll-bars on window.