[#6574] Add a Labor Budget JS template for adding more budget items
The JS template is generated by Rails for adding a new record and gets appended to the finance section using addNewDeliverableFinance() (JS).
This commit is contained in:
@@ -68,6 +68,15 @@ jQuery(function($) {
|
||||
}
|
||||
},
|
||||
|
||||
addNewDeliverableFinance = function(financeType) {
|
||||
var t = $('#labor-budget-template').tmpl({});
|
||||
var countOfExisting = $("#deliverable-labor tbody tr").size();
|
||||
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
|
||||
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
|
||||
|
||||
$("<tr>" + newContent + '</tr>').appendTo('#deliverable-labor tbody');
|
||||
},
|
||||
|
||||
toggleSpecificDeliverableFields($('form.deliverable'));
|
||||
|
||||
$('select#deliverable_type').change(function() {
|
||||
|
||||
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user