From 6952dd5c580572a346a8b407de5565bfffe089a7 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Fri, 30 Dec 2011 00:55:38 -0300 Subject: [PATCH] Fixing execution sync --- public/javascripts/manage-products.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/javascripts/manage-products.js b/public/javascripts/manage-products.js index b9a67f2..9b16c03 100644 --- a/public/javascripts/manage-products.js +++ b/public/javascripts/manage-products.js @@ -75,11 +75,16 @@ function updatePriceCompositionBar(form) { bar_url = jQuery(form).find('.bar-update-url').val(); - jQuery.get(bar_url, function(data){ - jQuery("#price-composition-bar").html(data); - jQuery('form #product_price').val(currencyToFloat(jQuery('#progressbar-text .product_price').html(), currency_format.separator, currency_format.delimiter)); - jQuery('form #product_inputs_cost').val(currencyToFloat(jQuery('#display-product-price-details .inputs-cost span').html(), currency_format.separator, currency_format.delimiter, currency_format.unit)); - calculateValuesForBar(); + jQuery.ajax({ + url : bar_url, + success : function(data) { + jQuery("#price-composition-bar").html(data); + }, + complete : function() { + jQuery('form #product_price').val(currencyToFloat(jQuery('#progressbar-text .product_price').html(), currency_format.separator, currency_format.delimiter)); + jQuery('form #product_inputs_cost').val(currencyToFloat(jQuery('#display-product-price-details .inputs-cost span').html(), currency_format.separator, currency_format.delimiter, currency_format.unit)); + calculateValuesForBar(); + } }); }; -- libgit2 0.21.2