// Fix bug with product image color loading on firefox

This commit is contained in:
mDeflotte
2012-02-14 15:36:11 +00:00
parent 9cd2b4e3d9
commit 02f581c858
+37 -34
View File
@@ -119,13 +119,13 @@ function findCombination(firstTime)
else else
selectedCombination['ecotax'] = default_eco_tax; selectedCombination['ecotax'] = default_eco_tax;
//show the large image in relation to the selected combination //show the large image in relation to the selected combination
if (combinations[combination]['image'] && combinations[combination]['image'] != -1) if (combinations[combination]['image'] && combinations[combination]['image'] != -1)
displayImage( $('#thumb_'+combinations[combination]['image']).parent() ); displayImage($('#thumb_'+combinations[combination]['image']).parent(), firstTime);
//show discounts values according to the selected combination //show discounts values according to the selected combination
if (combinations[combination]['idCombination'] && combinations[combination]['idCombination'] > 0) if (combinations[combination]['idCombination'] && combinations[combination]['idCombination'] > 0)
displayDiscounts(combinations[combination]['idCombination']); displayDiscounts(combinations[combination]['idCombination']);
//get available_date for combination product //get available_date for combination product
selectedCombination['available_date'] = combinations[combination]['available_date']; selectedCombination['available_date'] = combinations[combination]['available_date'];
@@ -406,10 +406,10 @@ function updateDisplay()
var productPricePretaxed = productPrice; var productPricePretaxed = productPrice;
$('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank)); $('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank));
/* Unit price */ /* Unit price */
productUnitPriceRatio = parseFloat(productUnitPriceRatio); productUnitPriceRatio = parseFloat(productUnitPriceRatio);
if (productUnitPriceRatio > 0 ) if (productUnitPriceRatio > 0 )
{ {
newUnitPrice = (productPrice / parseFloat(productUnitPriceRatio)) + selectedCombination['unit_price']; newUnitPrice = (productPrice / parseFloat(productUnitPriceRatio)) + selectedCombination['unit_price'];
$('#unit_price_display').text(formatCurrency(newUnitPrice, currencyFormat, currencySign, currencyBlank)); $('#unit_price_display').text(formatCurrency(newUnitPrice, currencyFormat, currencySign, currencyBlank));
} }
@@ -420,39 +420,42 @@ function updateDisplay()
} }
//update display of the large image //update display of the large image
function displayImage(domAAroundImgThumb) function displayImage(domAAroundImgThumb, no_animation)
{ {
if (domAAroundImgThumb.attr('href')) if (typeof(no_animation) == 'undefined')
{ no_animation = false;
var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');
if ($('#bigpic').attr('src') != newSrc) if (domAAroundImgThumb.attr('href'))
{ {
$('#bigpic').fadeOut('fast', function(){ var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');
$(this).attr('src', newSrc).show(); if ($('#bigpic').attr('src') != newSrc)
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) {
$(this).attr('alt', domAAroundImgThumb.attr('href')); $('#bigpic').fadeOut((no_animation ? 0 : 'fast'), function(){
}); $(this).attr('src', newSrc).show();
} if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
$('#views_block li a').removeClass('shown'); $(this).attr('alt', domAAroundImgThumb.attr('href'));
$(domAAroundImgThumb).addClass('shown'); });
} }
$('#views_block li a').removeClass('shown');
$(domAAroundImgThumb).addClass('shown');
}
} }
//update display of the discounts table //update display of the discounts table
function displayDiscounts(combination) function displayDiscounts(combination)
{ {
$('#quantityDiscount table tbody tr').each(function() { $('#quantityDiscount table tbody tr').each(function() {
if (($(this).attr('id') != 'quantityDiscount_0') && if (($(this).attr('id') != 'quantityDiscount_0') &&
($(this).attr('id') != 'quantityDiscount_'+combination) && ($(this).attr('id') != 'quantityDiscount_'+combination) &&
($(this).attr('id') != 'noQuantityDiscount')) ($(this).attr('id') != 'noQuantityDiscount'))
$(this).fadeOut('slow'); $(this).fadeOut('slow');
}); });
if ($('#quantityDiscount_'+combination).length != 0) { if ($('#quantityDiscount_'+combination).length != 0) {
$('#quantityDiscount_'+combination).show(); $('#quantityDiscount_'+combination).show();
$('#noQuantityDiscount').hide(); $('#noQuantityDiscount').hide();
} else } else
$('#noQuantityDiscount').show(); $('#noQuantityDiscount').show();
} }
// Serialscroll exclude option bug ? // Serialscroll exclude option bug ?