diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index c0beb7fc41..cd59db6f2e 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -8,7 +8,7 @@ $(function() { $('[data-id=' + e.id + ']').prop('checked', true); - var lineID = $('.nav li.active').attr('lineid'); + var lineID = $('.nav li.currentPage').attr('lineid'); var checkedLines = true; var checkedProduct = true; var checkedProject = true; @@ -19,7 +19,7 @@ $(function() { if($('.nav li.currentPage').find('[id^=productLines]').prop('checked')) { - var lineID = $('.nav li.active').attr('lineid'); + var lineID = $('.nav li.currentPage').attr('lineid'); $('#checkAllProducts').prop('checked', true); $('#checkAllProjects').prop('checked', true); $("[id^='products\[" + lineID + "\]']").prop('checked', true); @@ -138,13 +138,14 @@ $(function() /* Select all product events. */ $('#checkAllProducts').click(function() { - var lineID = $('li.active').attr('lineid'); + var lineID = $('li.currentPage').attr('lineid'); if($(this).is(':checked')) { $("[id^='productLines\[" + lineID + "\]']").prop('checked', true); $('#checkAllProjects').prop('checked', true); $('[name^=products]').prop('checked', true); $('[name^=sprints]').prop('checked', true); + $('#programName').val($('.main-row .side-col .nav li.currentPage div a').text()); } else { @@ -152,6 +153,7 @@ $(function() $('#checkAllProjects').prop('checked', false); $('[name^=products]').prop('checked', false); $('[name^=sprints]').prop('checked', false); + $('#programName').val(''); } hiddenProject(); }) @@ -159,13 +161,14 @@ $(function() /* Select all project events. */ $('#checkAllProjects').click(function() { - var lineID = $('li.active').attr('lineid'); + var lineID = $('li.currentPage').attr('lineid'); if($(this).is(':checked')) { $("[id^='productLines\[" + lineID + "\]']").prop('checked', true); $('#checkAllProducts').prop('checked', true); $('[name^=products]').prop('checked', true); $('[name^=sprints]').prop('checked', true); + $('#programName').val($('.main-row .side-col .nav li.currentPage div a').text()); } else { @@ -173,6 +176,7 @@ $(function() $('#checkAllProducts').prop('checked', false); $('[name^=products]').prop('checked', false); $('[name^=sprints]').prop('checked', false); + $('#programName').val(''); } hiddenProject(); }) @@ -268,11 +272,12 @@ $(function() } var currentLine = $(this).closest('li').attr('lineid'); - $(this).closest('ul').find('li').removeClass('currentPage'); - $(this).closest('li').addClass('currentPage'); /* Active current li and remove active before li. */ $(this).closest('li').addClass('active'); + $(this).closest('ul').find('li').removeClass('currentPage'); + $(this).closest('li').addClass('currentPage'); + $('[id^=productLines]').each(function() { var lineID = $(this).val(); @@ -318,7 +323,7 @@ $(function() } else if($(this).closest("li").find('[id^=productLines]').prop('checked')) { - var productLine = $('.nav li.active').attr('lineid'); + var productLine = $('.nav li.currentPage').attr('lineid'); var objectNum = $('[data-line='+ productLine +']').length; var checkedObjectNum = $('[data-line='+ productLine +']:checked').length; if(objectNum == checkedObjectNum)