Skip to content

Commit

Permalink
fix for Order Edit line item calculation re-populate
Browse files Browse the repository at this point in the history
  • Loading branch information
Trung LE authored and BDQ committed Dec 13, 2010
1 parent b43fb39 commit 38bce53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/public/javascripts/admin/orders/edit_form.js
@@ -1,15 +1,16 @@
$.each($('td.qty input'), function(i, inpt){
$(inpt).delayedObserver(0.5, function(object, value) {

var id = object.attr('id').replace("order_line_items_attributes_", "").replace("_quantity", "");
$(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]": value}),
data: ({_method: "put", "line_item[quantity]": $(this).val()}),
success: function(html){ $('#order-form-wrapper').html(html)}
});

});
}, 0,5);
});

0 comments on commit 38bce53

Please sign in to comment.