diff options
Diffstat (limited to 'horizon')
7 files changed, 20 insertions, 14 deletions
diff --git a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js index c4f8fb5af..4aca18f32 100644 --- a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js +++ b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js @@ -17,6 +17,7 @@ 'use strict'; var READONLY_PROPERTIES = ['os_hash_algo', 'os_hash_value']; + var DUPLICATE_PROPERTIES = ['description']; angular .module('horizon.framework.widgets.metadata.tree') @@ -41,6 +42,11 @@ ctrl.item.leaf.required = false; } + if ('item' in ctrl && 'leaf' in ctrl.item && + DUPLICATE_PROPERTIES.includes(ctrl.item.leaf.name)) { + delete ctrl.item; + } + if ('item' in ctrl && 'leaf' in ctrl.item && ctrl.item.leaf.type === 'array') { ctrl.values = ctrl.item.leaf.items.enum.filter(filter).sort(); 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 4c3799b1f..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; @@ -486,7 +486,7 @@ horizon.membership = { // unfocus filter fields if (step_id.indexOf('update') === 0) { - $form.find("#" + step_id + " input").blur(); + $form.find("#" + step_id + " input").trigger('blur'); } // prevent filter inputs from submitting form on 'enter' 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 00cd692e9..50a28900f 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); } diff --git a/horizon/static/horizon/js/horizon.users.js b/horizon/static/horizon/js/horizon.users.js index 4059d6256..7e8e8588c 100644 --- a/horizon/static/horizon/js/horizon.users.js +++ b/horizon/static/horizon/js/horizon.users.js @@ -15,13 +15,13 @@ horizon.user = { init: function() { - $("#id_password").change(function () { + $("#id_password").on('change', function () { if ($("#id_confirm_password").val() !== "") { horizon.user.check_passwords_match(); } }); - $("#id_confirm_password").change(function () { + $("#id_confirm_password").on('change', function () { horizon.user.check_passwords_match(); }); }, |