diff --git a/app/views/plans/_plan_details.html.erb b/app/views/plans/_plan_details.html.erb index 981b3c0..98e6fd5 100644 --- a/app/views/plans/_plan_details.html.erb +++ b/app/views/plans/_plan_details.html.erb @@ -16,7 +16,7 @@
<%= section.title %>
diff --git a/lib/assets/javascripts/projects.js b/lib/assets/javascripts/projects.js index 9e1c870..c32016c 100644 --- a/lib/assets/javascripts/projects.js +++ b/lib/assets/javascripts/projects.js @@ -1,116 +1,5 @@ $( document ).ready(function() { $(".select2-container").select2(); - - // ---------------------------------------------------------- - $("#plan_funder_id").change(function(){ - -// if($(this).select2().val().length > 0){ -// $("#other-funder-name").hide(); -// $("#project_funder_name").val(""); -// -// }else{ -// $("#other-funder-name").show(); -// } - -// $("#institution-control-group").show(); - $("#create-plan-button").show(); - $("#confirm-funder").text($("#project_funder_id option:selected").text()); - getTemplateList(); - }); - - // ---------------------------------------------------------- - $("#project_institution_idX").change(function(){ - reloadTemplateData(); - - $("#confirm-institution").text($("#project_institution_id option:selected").text()); - }); - - // ---------------------------------------------------------- - $("#project_dmptemplate_idX").change(function(){ - reloadGuidanceOptions(); - }); - - // ---------------------------------------------------------- - $("#no-funderX").click(function(e) { - e.preventDefault(); - // For some reason we need to access the select2 box's value again to get the - // UI to update correctly - $("#project_funder_id").select2().val(""); - $("#project_funder_id").select2().val(); - - $("#institution-control-group").show(); - $("#create-plan-button").show(); - $("#other-funder-name").show(); - $("#confirm-funder").text(I18n.t("helpers.none")); - reloadTemplateData(); - }); - - // ---------------------------------------------------------- - $("#project_funder_nameX").change(function(){ - $("#confirm-funder").text($("#project_funder_id :selected").text()); - reloadTemplateData(); - }); - - // ---------------------------------------------------------- - $("#no-institutionX").click(function() { - // For some reason we need to access the select2 box's value again to get the - // UI to update correctly - $("#project_institution_id").select2().val(""); - $("#project_institution_id").select2().val(); - - $("#confirm-institution").text(I18n.t("helpers.none")); - }); - - // ---------------------------------------------------------- - $("#project-confirmation-dialogX").on("show", function(){ - if ($("#confirm-institution").text() == "") { - $("#confirm-institution").text(I18n.t("helpers.none")); - } - if ($("#confirm-funder").text() == "") { - $("#confirm-funder").text(I18n.t("helpers.none")); - } - if ($("#confirm-template").text() == "") { - $("#confirm-template").closest("div").hide(); - } - else { - $("#confirm-template").closest("div").show(); - } - $("#confirm-guidance").empty(); - $("input:checked").each(function(){ - $("#confirm-guidance").append("