Fixed indenting
This commit is contained in:
parent
a50ec14b5d
commit
38499864a9
|
|
@ -13,7 +13,7 @@ $(function() {
|
||||||
/**
|
/**
|
||||||
* A more generic way of handling the HABTM <ul> <li>[REMOVE BUTTON] NAME [HIDDEN INPUT]</li> </ul>
|
* A more generic way of handling the HABTM <ul> <li>[REMOVE BUTTON] NAME [HIDDEN INPUT]</li> </ul>
|
||||||
* Copypasta'd from add_edit_shipment.js.
|
* Copypasta'd from add_edit_shipment.js.
|
||||||
*/
|
*/
|
||||||
function addToList(modelName, id, value, ULelement) {
|
function addToList(modelName, id, value, ULelement) {
|
||||||
var thisLI = $('<li></li>');
|
var thisLI = $('<li></li>');
|
||||||
var thisButton = $('<button>X</button>');
|
var thisButton = $('<button>X</button>');
|
||||||
|
|
@ -24,25 +24,25 @@ $(function() {
|
||||||
|
|
||||||
var modelString = '['+modelName+']';
|
var modelString = '['+modelName+']';
|
||||||
|
|
||||||
thisHiddenInput.attr('name', 'data[PurchaseOrder]'+modelString+'[]');
|
thisHiddenInput.attr('name', 'data[PurchaseOrder]'+modelString+'[]');
|
||||||
|
|
||||||
thisHiddenInput.attr('value', id);
|
thisHiddenInput.attr('value', id);
|
||||||
|
|
||||||
thisLI.attr('id', modelName+'ID_'+id);
|
thisLI.attr('id', modelName+'ID_'+id);
|
||||||
thisLI.html(value);
|
thisLI.html(value);
|
||||||
thisLI.prepend(thisButton);
|
thisLI.prepend(thisButton);
|
||||||
thisLI.append(thisHiddenInput);
|
thisLI.append(thisHiddenInput);
|
||||||
ULelement.append(thisLI);
|
ULelement.append(thisLI);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Remove X button clicked.
|
|
||||||
$('.removeFromList').live('click', function() {
|
}
|
||||||
$(this).parent().remove();
|
|
||||||
});
|
|
||||||
|
//Remove X button clicked.
|
||||||
|
$('.removeFromList').live('click', function() {
|
||||||
|
$(this).parent().remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -295,7 +295,7 @@ $(function() {
|
||||||
|
|
||||||
var productID = getSelectedID('#productSelect');
|
var productID = getSelectedID('#productSelect');
|
||||||
getProductDetails(productID);
|
getProductDetails(productID);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function getProductDetails(productID) {
|
function getProductDetails(productID) {
|
||||||
|
|
@ -420,7 +420,7 @@ $(function() {
|
||||||
|
|
||||||
$("#emailDocButton").click(function() {
|
$("#emailDocButton").click(function() {
|
||||||
var confirmed = confirm("This will email this Document and all Attachments to the Contact. Are you sure you want to do this?");
|
var confirmed = confirm("This will email this Document and all Attachments to the Contact. Are you sure you want to do this?");
|
||||||
|
|
||||||
if(confirmed) {
|
if(confirmed) {
|
||||||
window.location = $(this).data('url');
|
window.location = $(this).data('url');
|
||||||
}
|
}
|
||||||
|
|
@ -496,7 +496,7 @@ $(function() {
|
||||||
|
|
||||||
if($('#JobID_'+ui.item.id).length == 0) { //This Job is not already in the List.
|
if($('#JobID_'+ui.item.id).length == 0) { //This Job is not already in the List.
|
||||||
addToList('Job', ui.item.id, ui.item.value, $('#jobsList'));
|
addToList('Job', ui.item.id, ui.item.value, $('#jobsList'));
|
||||||
|
|
||||||
var jobs_val = $("#PurchaseOrderJobsText").val();
|
var jobs_val = $("#PurchaseOrderJobsText").val();
|
||||||
|
|
||||||
$("#PurchaseOrderJobsText").val(jobs_val +', '+ ui.item.value)
|
$("#PurchaseOrderJobsText").val(jobs_val +', '+ ui.item.value)
|
||||||
|
|
@ -504,11 +504,11 @@ $(function() {
|
||||||
console.log(ui.item.value);
|
console.log(ui.item.value);
|
||||||
//POST the job ID to a method on the documents controller to add the LineItems
|
//POST the job ID to a method on the documents controller to add the LineItems
|
||||||
$.post('/documents/add_job_items_to_po/'+ui.item.id+'/'+$("#DocumentId").val(), function(data) {
|
$.post('/documents/add_job_items_to_po/'+ui.item.id+'/'+$("#DocumentId").val(), function(data) {
|
||||||
|
|
||||||
loadLineItems();
|
loadLineItems();
|
||||||
saveDocument('Purchase Order');
|
saveDocument('Purchase Order');
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue