[#6574] Add button for multiple Labor Budgets

This commit is contained in:
Eric Davis
2011-10-11 10:17:47 -07:00
parent f0445324ea
commit 237b220795
2 changed files with 8 additions and 2 deletions

View File

@@ -14,7 +14,7 @@
<p class="inline-hints"><%= labor_budget.label(:budget, l(:text_dollar_sign)) %></p>
<%= labor_budget.text_field(:budget, :value => format_deliverable_value_fields(labor_budget.object.budget), :class => 'financial') %>
</td>
<td>
<%= release(3, "Green Add button for multiple records") %>
<td class="add-labor">
<%= link_to_function("Add", 'addNewDeliverableFinance("labor")', :class => 'icon icon-add', :style => 'display:none;') %>
</td>
</tr>

View File

@@ -68,6 +68,10 @@ jQuery(function($) {
}
},
showDeliverableAddButton = function() {
$('.add-labor a').hide().last().show();
},
addNewDeliverableFinance = function(financeType) {
var t = $('#labor-budget-template').tmpl({});
var countOfExisting = $("#deliverable-labor tbody tr").size();
@@ -75,8 +79,10 @@ jQuery(function($) {
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
$("<tr>" + newContent + '</tr>').appendTo('#deliverable-labor tbody');
showDeliverableAddButton();
},
showDeliverableAddButton();
toggleSpecificDeliverableFields($('form.deliverable'));
$('select#deliverable_type').change(function() {