mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
19 lines
567 B
JavaScript
19 lines
567 B
JavaScript
$.each($('td.qty input'), function(i, inpt){
|
|
|
|
$(inpt).delayedObserver(function() {
|
|
|
|
var id = $(this).attr('id').replace("order_line_items_attributes_", "").replace("_quantity", "");
|
|
id = "#order_line_items_attributes_" + id + "_id";
|
|
|
|
jQuery.ajax({
|
|
type: "POST",
|
|
url: "/admin/orders/" + $('input#order_number').val() + "/line_items/" + $(id).val(),
|
|
data: ({_method: "put", "line_item[quantity]": $(this).val()}),
|
|
complete: function(resp){
|
|
$('#order-form-wrapper').html(resp.responseText);
|
|
}
|
|
});
|
|
|
|
}, 0,5);
|
|
});
|