summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-26 23:58:29 +0000
committerGerrit Code Review <review@openstack.org>2023-04-26 23:58:29 +0000
commitda7173515df08b32d9eb23d403e38512c772965a (patch)
treee17ffa87304b283a47605e742fadc0e0e12fb8c1
parentce6d55ddcf1f91d3792cfa0b0fd98b402da0f0ad (diff)
parent2d6cdae1467f4999c6ae5d636f35026ee1bc71a6 (diff)
downloadhorizon-da7173515df08b32d9eb23d403e38512c772965a.tar.gz
Merge "Fix deprecation warning for .removeAttr()"
-rw-r--r--horizon/static/horizon/js/horizon.forms.js8
-rw-r--r--horizon/static/horizon/js/horizon.lists.js2
-rw-r--r--horizon/static/horizon/js/horizon.membership.js4
-rw-r--r--horizon/static/horizon/js/horizon.modals.js6
-rw-r--r--horizon/static/horizon/js/horizon.tables.js2
5 files changed, 11 insertions, 11 deletions
diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js
index 00e41478e..27a7e9bd6 100644
--- a/horizon/static/horizon/js/horizon.forms.js
+++ b/horizon/static/horizon/js/horizon.forms.js
@@ -74,7 +74,7 @@ horizon.forms = {
if ($option.val() == "subnetpool") {
$ipVersion.attr("disabled", "disabled");
} else {
- $ipVersion.removeAttr("disabled");
+ $ipVersion.prop("disabled", false);
}
});
},
@@ -198,7 +198,7 @@ horizon.forms.handle_submit = function (el) {
// Remove disabled attribute on select fields before submit to get value
// included in POST request.
$this.find('select[disabled="disabled"]').each(function (i, field) {
- $(field).removeAttr("disabled");
+ $(field).prop("disabled", false);
});
return true;
});
@@ -379,7 +379,7 @@ horizon.forms.checkSpinnerValue = function($inputs) {
var $up = $parent.find('.spinner-up');
var $down = $parent.find('.spinner-down');
- $parent.find('.themable-spinner-btn').removeAttr('disabled');
+ $parent.find('.themable-spinner-btn').prop('disabled', false);
if (val <= min) {
// Disable if we've hit the min
@@ -516,7 +516,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
//The required verification should be removed and recorded
if ($input.attr('required') === 'required') {
$input.data('savedRequired', 'required');
- $input.removeAttr('required');
+ $input.prop('required', false);
}
} else {
//If the input is a checkbox no need to replace html for label since it has another structure
diff --git a/horizon/static/horizon/js/horizon.lists.js b/horizon/static/horizon/js/horizon.lists.js
index 123dfdc30..3782be327 100644
--- a/horizon/static/horizon/js/horizon.lists.js
+++ b/horizon/static/horizon/js/horizon.lists.js
@@ -25,7 +25,7 @@ horizon.lists = {
var active_features = $("#selected_"+type+" > li").map(function () {
return $(this).attr("name");
});
- $("#"+type+"ListId input:checkbox").removeAttr('checked');
+ $("#"+type+"ListId input:checkbox").prop('checked', false);
active_features.each(function (index, value) {
$("#"+type+"ListId input:checkbox[value=" + value + "]")
.prop('checked', true)
diff --git a/horizon/static/horizon/js/horizon.membership.js b/horizon/static/horizon/js/horizon.membership.js
index 678e109f6..39b6e042c 100644
--- a/horizon/static/horizon/js/horizon.membership.js
+++ b/horizon/static/horizon/js/horizon.membership.js
@@ -318,7 +318,7 @@ horizon.membership = {
}
else {
$('#no_' + filter).hide();
- $("input[id='" + filter + "']").removeAttr('disabled');
+ $("input[id='" + filter + "']").prop('disabled', false);
}
});
},
@@ -446,7 +446,7 @@ horizon.membership = {
},
'testQuery': function (query, txt, span) {
if ($(input).attr('id') === filter) {
- $(input).prev().removeAttr('disabled');
+ $(input).prev().prop('disabled', false);
return query.test($(span).text());
} else {
return true;
diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js
index a7d5cb4b4..87e546ca2 100644
--- a/horizon/static/horizon/js/horizon.modals.js
+++ b/horizon/static/horizon/js/horizon.modals.js
@@ -121,7 +121,7 @@ horizon.modals.init_wizard = function () {
});
// Temporarilly remove "disabled" attribute to get the values serialized
- var disabled = $form.find('select[disabled="disabled"]').removeAttr("disabled");
+ var disabled = $form.find('select[disabled="disabled"]').prop("disabled", false);
// Send the data for validation.
$.ajax({
@@ -321,7 +321,7 @@ horizon.addInitFunction(horizon.modals.init = function() {
add_to_field_header = jqXHR.getResponseHeader("X-Horizon-Add-To-Field"),
json_data, field_to_update;
if (redirect_header === null) {
- $('.ajax-modal, .dropdown-toggle').removeAttr("disabled");
+ $('.ajax-modal, .dropdown-toggle').prop("disabled", false);
}
content_disposition = jqXHR.getResponseHeader("content-disposition");
@@ -361,7 +361,7 @@ horizon.addInitFunction(horizon.modals.init = function() {
if (jqXHR.getResponseHeader('logout')) {
location.href = jqXHR.getResponseHeader("X-Horizon-Location");
} else {
- $('.ajax-modal, .dropdown-toggle').removeAttr("disabled");
+ $('.ajax-modal, .dropdown-toggle').prop("disabled", false);
$formElement.closest(".modal").modal("hide");
horizon.toast.add("danger", gettext("There was an error submitting the form. Please try again."));
}
diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js
index 878371642..7b8d99632 100644
--- a/horizon/static/horizon/js/horizon.tables.js
+++ b/horizon/static/horizon/js/horizon.tables.js
@@ -609,7 +609,7 @@ horizon.datatables.update_header_checkbox = function(table) {
$multi_select_checkbox.prop('checked', false);
$multi_select_checkbox.attr('disabled', true);
} else {
- $multi_select_checkbox.removeAttr('disabled');
+ $multi_select_checkbox.prop('disabled', false);
var not_checked = $checkboxes.not(':checked').length;
$multi_select_checkbox.prop('checked', not_checked == 0);
}