diff --git a/module/program/js/common.js b/module/program/js/common.js index 17b3a4acf1..46541b6234 100644 --- a/module/program/js/common.js +++ b/module/program/js/common.js @@ -283,7 +283,7 @@ $(function() if($(this).prop('checked')) { $('#budget').val('').attr('disabled', 'disabled'); - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); } else { @@ -362,14 +362,15 @@ function compareChildDate() var dateTip = ''; if(programBegin > childBegin) { - dateTip = "

" + beginGreateChild + childInfo.minChildBegin + "

" + ignore + "

"; + dateTip = "

" + beginGreateChild + childInfo.minChildBegin + "

" + ignore + "

"; } else if(programEnd < childEnd) { - dateTip = "

" + endLetterChild + childInfo.maxChildEnd + "

" + ignore + "

"; + dateTip = "

" + endLetterChild + childInfo.maxChildEnd + "

" + ignore + "

"; } - $('#dateBox').after(dateTip); + $('#dateBox').parent().parent().after(dateTip); + $('#dateTip').parent().css('line-height', '0'); }); } } @@ -386,7 +387,7 @@ function outOfDateTip() var end = $('#end').val(); var begin = $('#begin').val(); - if($('#dateTip').length > 0) $('#dateTip').remove(); + if($('#dateTip').length > 0) $('#dateTip').parent().parent().remove(); if(end == longTime) end = LONG_TIME; if(end.length > 0 && begin.length > 0) @@ -417,14 +418,15 @@ function outOfDateTip() if(programBegin < parentBegin) { - dateTip = "

" + beginLetterParent + data.selectedProgramBegin + "

" + ignore + "

"; + dateTip = "

" + beginLetterParent + data.selectedProgramBegin + "

" + ignore + "

"; } else if(programEnd > parentEnd) { - dateTip = "

" + endGreaterParent + data.selectedProgramEnd + "

" + ignore + "

"; + dateTip = "

" + endGreaterParent + data.selectedProgramEnd + "

" + ignore + "

"; } - $('#dateBox').after(dateTip); + $('#dateBox').parent().parent().after(dateTip); + $('#dateTip').parent().css('line-height', '0'); }); } } @@ -443,7 +445,7 @@ function budgetOverrunTips() var budget = $('#budget').val(); if(selectedProgramID == 0) { - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); return false; } @@ -453,9 +455,10 @@ function budgetOverrunTips() var data = JSON.parse(data); var tip = ""; - if(budget !=0 && budget !== null && budget > data.availableBudget) var tip = "

" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget + "

" + ignore + "

" - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); - $('#budgetBox').after(tip); + if(budget !=0 && budget !== null && budget > data.availableBudget) var tip = "

" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget + "

" + ignore + "

" + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); + $('#budgetBox').parent().parent().after(tip); + $('#beyondBudgetTip').parent().css('line-height', '0'); }); } diff --git a/module/project/js/common.js b/module/project/js/common.js index 7ce2365ef8..58b6b3252f 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -295,7 +295,7 @@ $(function() if($(this).prop('checked')) { $('#budget').val('').attr('disabled', 'disabled'); - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); } else { @@ -340,7 +340,7 @@ function budgetOverrunTips() if(selectedProgramID == 0) { - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); return false; } @@ -351,9 +351,10 @@ function budgetOverrunTips() if(typeof(data.availableBudget) == 'undefined') return; var tip = ""; - if(budget != 0 && budget !== null && budget > data.availableBudget) tip = "

" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget.toFixed(2) + "

" + ignore + "

" - if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove(); - $('#budgetBox').after(tip); + if(budget != 0 && budget !== null && budget > data.availableBudget) tip = "

" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget.toFixed(2) + "

" + ignore + "

" + if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').parent().parent().remove(); + $('#budgetBox').parent().parent().after(tip); + $('#beyondBudgetTip').parent().css('line-height', '0'); var placeholder = ''; if(selectedProgramID) placeholder = parentBudget + currencySymbol[data.budgetUnit] + data.availableBudget.toFixed(2); @@ -374,7 +375,7 @@ function outOfDateTip(currentID = 0) if(window.ignoreTips['dateTip']) return; var end = currentID ? $('#ends\\[' + currentID + '\\]').val() : $('#end').val(); var begin = currentID ? $('#begins\\[' + currentID + '\\]').val() : $('#begin').val(); - if($('#dateTip.text-remind').length > 0) $('#dateTip').remove(); + if($('#dateTip.text-remind').length > 0) $('#dateTip').parent().parent().remove(); if(currentID) $('#dateTip\\[' + currentID + '\\]').remove(); if(end == longTime) end = LONG_TIME; @@ -396,7 +397,6 @@ function outOfDateTip(currentID = 0) var beginLetterParentTip = beginLetterParent + data.selectedProgramBegin; var endGreaterParentTip = endGreaterParent + data.selectedProgramEnd; - var dateExceedParentTip = dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd; if(projectBegin >= parentBegin && projectEnd <= parentEnd) return; @@ -416,7 +416,8 @@ function outOfDateTip(currentID = 0) } else { - $('#dateBox').after("

" + dateTip + "

" + ignore + "

"); + $('#dateRange').parent().after("

" + dateTip + "

" + ignore + "

"); + $('#dateTip').parent().css('line-height', '0') } }); }