From cb6f696dad0ea088ff62bd2a1cb46e42af86e9ff Mon Sep 17 00:00:00 2001 From: AntonLejon Date: Mon, 6 May 2013 12:14:11 +0300 Subject: [PATCH] [*] MO: blockcart animation optimization The animated element would not be removed upon the animation being finished. This made the site slow and unresponsive if the animated image was heavy (eg. a transparent png) and added to cart many times without reloading the page. This addition makes the animation behave as expected also when performing it multiple times. --- modules/blockcart/ajax-cart.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index c42dc72cf..8641931c5 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -232,6 +232,7 @@ var ajaxCart = { .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) .fadeOut(100, function() { ajaxCart.updateCartInformation(jsonData, addedFromProductPage); + $(this).remove(); }); } else