From 1652f3575c10995b8e088c5cf185b9f8ee77d32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20B=C3=A9lorgey?= Date: Tue, 28 May 2013 09:37:32 +0200 Subject: [PATCH] [*] MO : blockcart - simpler selectors --- modules/blockcart/ajax-cart.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index ae99815e7..df74b0c63 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -313,7 +313,7 @@ var ajaxCart = { // If the cart is now empty, show the 'no product in the cart' message and close detail if($('#cart_block dl.products dt').length == 0) { - $("#header #cart_block").stop(true, true).slideUp(200); + $("#cart_block").stop(true, true).slideUp(200); $('#cart_block_no_products:hidden').slideDown(450); $('#cart_block dl.products').remove(); } @@ -377,7 +377,7 @@ var ajaxCart = { else { $('#vouchers tbody').html(''); - + for (i=0;i 0) @@ -428,7 +428,7 @@ var ajaxCart = { if (this.id != undefined) { //create a container for listing the products and hide the 'no product in the cart' message (only if the cart was empty) - + if ($('#cart_block dl.products').length == 0) { $('#cart_block_no_products').before('
'); @@ -445,7 +445,7 @@ var ajaxCart = { content += '' + this.quantity + 'x'; var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name); content += '' + name + ''; - + if (parseFloat(this.price_float) > 0) content += ' '; else @@ -595,7 +595,7 @@ var ajaxCart = { //update general cart informations everywhere in the page updateCartEverywhere : function(jsonData) { $('.ajax_cart_total').text($.trim(jsonData.productTotal)); - + if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1) $('.ajax_cart_shipping_cost').text(jsonData.shippingCost); else if (typeof(freeShippingTranslation) != 'undefined') @@ -605,7 +605,7 @@ var ajaxCart = { $('.ajax_block_cart_total').text(jsonData.total); this.nb_total_products = jsonData.nbTotalProducts; - + if (parseInt(jsonData.nbTotalProducts) > 0) { $('.ajax_cart_no_product').hide(); @@ -689,10 +689,10 @@ $(document).ready(function(){ $("#cart_block").stop(true, true).slideDown(450); }, function() { - $('#header #shopping_cart a').css('border-radius', '3px'); + $('#shopping_cart a').css('border-radius', '3px'); setTimeout(function() { if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver()) - $("#header #cart_block").stop(true, true).slideUp(450); + $("#cart_block").stop(true, true).slideUp(450); }, 200); } ); @@ -705,17 +705,17 @@ $(document).ready(function(){ $('#shopping_cart a').css('border-radius', '3px'); setTimeout(function() { if (!shopping_cart.isHoveringOver()) - $("#header #cart_block").stop(true, true).slideUp(450); + $("#cart_block").stop(true, true).slideUp(450); }, 200); } ); - + $('.delete_voucher').live('click', function() { $.ajax({ - type: 'POST', + type: 'POST', headers: { "cache-control": "no-cache" }, async: true, - cache: false, + cache: false, url:$(this).attr('href') + '?rand=' + new Date().getTime() }); $(this).parent().parent().remove();