app/assets/javascripts/katello/containers/container.js in katello-3.5.0.rc2 vs app/assets/javascripts/katello/containers/container.js in katello-3.5.0

- old
+ new

@@ -1,8 +1,9 @@ var KT = KT ? KT : {}; KT.container = (function(){ + var pre_selection = {}; var setup = function() { var orgDropdown = $('#organization_id'), envDropdown = $('#kt_environment_id'), contentViewDropdown = $('#content_view_id'), reposDropdown = $("#repository_id"), @@ -134,10 +135,11 @@ $.each(data["results"], function(index, cv) { contentViewDropdown.append( $('<option></option>').val(cv["id"]).html(cv["name"])); }); enableContentViews(true); + contentViewDropdown.val(pre_selection.content_view_id).trigger('change') } else { noCV.removeClass("hide"); } }) @@ -171,10 +173,11 @@ $.each(data["results"], function(index, repo) { reposDropdown.append( $('<option></option>').val(repo["id"]).html(repo["name"])); }); enableRepositories(true); + reposDropdown.val(pre_selection.repository_id).trigger('change'); } else { noRepos.removeClass("hide"); } }) .fail(function(resp) { @@ -202,10 +205,11 @@ $.each(data["results"], function(index, tag) { tagsDropdown.append( $('<option></option>').val(tag["id"]).html(tag["name"])); }); enableTags(true); + tagsDropdown.val(pre_selection.tag_id).trigger('change') }) .fail(function(resp) { $("#error_tags").removeClass("hide") }) .always(function() { @@ -276,12 +280,17 @@ spinner.removeClass("hide"); } else { spinner.addClass("hide") } }; - + setSelection = function(selection) { + pre_selection = selection; + $('#kt_environment_id').val(selection.environment_id) + .trigger('change') + } return { setup: setup, + setSelection: setSelection, enableNext: enableNext }; })();