[#6574] Handle a missing labor budget template
This commit is contained in:
@@ -80,12 +80,14 @@ jQuery(function($) {
|
|||||||
|
|
||||||
addNewDeliverableFinance = function(financeType) {
|
addNewDeliverableFinance = function(financeType) {
|
||||||
var t = $('#labor-budget-template').tmpl({});
|
var t = $('#labor-budget-template').tmpl({});
|
||||||
var countOfExisting = $("tr.labor-budget-form").size();
|
if (t.length > 0) {
|
||||||
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
|
var countOfExisting = $("tr.labor-budget-form").size();
|
||||||
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
|
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
|
||||||
|
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
|
||||||
|
|
||||||
$("<tr class='labor-budget-form'>" + newContent + '</tr>').appendTo('#deliverable-labor tbody');
|
$("<tr class='labor-budget-form'>" + newContent + '</tr>').appendTo('#deliverable-labor tbody');
|
||||||
showDeliverableAddButton();
|
showDeliverableAddButton();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set the deleted flag for Rails and move it out of the row into
|
// Set the deleted flag for Rails and move it out of the row into
|
||||||
|
|||||||
Reference in New Issue
Block a user