Commit 6952dd5c580572a346a8b407de5565bfffe089a7

Authored by Caio Almeida
Committed by Daniela Feitosa
1 parent 14528538

Fixing execution sync

(ActionItem1413)
Showing 1 changed file with 10 additions and 5 deletions   Show diff stats
public/javascripts/manage-products.js
... ... @@ -75,11 +75,16 @@
75 75  
76 76 function updatePriceCompositionBar(form) {
77 77 bar_url = jQuery(form).find('.bar-update-url').val();
78   - jQuery.get(bar_url, function(data){
79   - jQuery("#price-composition-bar").html(data);
80   - jQuery('form #product_price').val(currencyToFloat(jQuery('#progressbar-text .product_price').html(), currency_format.separator, currency_format.delimiter));
81   - 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));
82   - calculateValuesForBar();
  78 + jQuery.ajax({
  79 + url : bar_url,
  80 + success : function(data) {
  81 + jQuery("#price-composition-bar").html(data);
  82 + },
  83 + complete : function() {
  84 + jQuery('form #product_price').val(currencyToFloat(jQuery('#progressbar-text .product_price').html(), currency_format.separator, currency_format.delimiter));
  85 + 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));
  86 + calculateValuesForBar();
  87 + }
83 88 });
84 89 };
85 90  
... ...