[-] FO : Fix bug #PSCFV-7743 and #PSCFV-8286, bigpic source change
This commit is contained in:
1 parent
976dcaf582
commit
01b088370c
3 files changed
+86
-40
No files matched your search
@@ -118,7 +118,7 @@ function findCombination(firstTime)
|
||||
|
||||
//show the large image in relation to the selected combination
|
||||
if (combinations[combination]['image'] && combinations[combination]['image'] != -1)
|
||||
displayImage($('.thumb_' + combinations[combination]['image']).parent());
|
||||
displayImage($('#thumb_' + combinations[combination]['image']).parent());
|
||||
|
||||
//show discounts values according to the selected combination
|
||||
if (combinations[combination]['idCombination'] && combinations[combination]['idCombination'] > 0)
|
||||
@@ -418,8 +418,12 @@ function displayImage(domAAroundImgThumb, no_animation)
|
||||
if (domAAroundImgThumb.attr('href'))
|
||||
{
|
||||
var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');
|
||||
if ($('#bigpic').attr('src') != newSrc)
|
||||
if(typeof(bigpicSrc) == 'undefined' || bigpicSrc == '')
|
||||
bigpicSrc = $('#bigpic').attr('src');
|
||||
if (bigpicSrc != newSrc)
|
||||
{
|
||||
//fadeOut is too slow, displayImage can be called again before bigpic source has really changed so we use a global bigpicSrc
|
||||
bigpicSrc = newSrc;
|
||||
$('#bigpic').fadeOut((no_animation ? 0 : 'fast'), function(){
|
||||
$(this).attr('src', newSrc).show();
|
||||
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
|
||||
@@ -468,24 +472,29 @@ function serialScrollFixLock(event, targeted, scrolled, items, position)
|
||||
function refreshProductImages(id_product_attribute)
|
||||
{
|
||||
$('#thumbs_list_frame').scrollTo('li:eq(0)', 700, {axis:'x'});
|
||||
$('#thumbs_list li').hide();
|
||||
|
||||
id_product_attribute = parseInt(id_product_attribute);
|
||||
|
||||
if (typeof(combinationImages) != 'undefined' && typeof(combinationImages[id_product_attribute]) != 'undefined')
|
||||
if (id_product_attribute > 0 && typeof(combinationImages) != 'undefined' && typeof(combinationImages[id_product_attribute]) != 'undefined')
|
||||
{
|
||||
$('#thumbs_list li').hide();
|
||||
$('#thumbs_list').trigger('goto', 0);
|
||||
for (var i = 0; i < combinationImages[id_product_attribute].length; i++)
|
||||
$('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show();
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
var thumb_width = $('#thumbs_list_frame >li').width() + parseInt($('#thumbs_list_frame >li').css('marginRight'));
|
||||
$('#thumbs_list_frame').width((parseInt((thumb_width)* i) + 3) + 'px'); // Bug IE6, needs 3 pixels more ?
|
||||
if (parseInt($('#thumbs_list_frame >li').length) != parseInt($('#thumbs_list_frame >li:visible').length))
|
||||
$('#wrapResetImages').show('slow');
|
||||
else
|
||||
$('#wrapResetImages').hide('slow');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#thumbnail_' + idDefaultImage).show();
|
||||
displayImage($('#thumbnail_' + idDefaultImage + ' a'));
|
||||
$('#thumbs_list li').show();
|
||||
if (parseInt($('#thumbs_list_frame >li').length) == parseInt($('#thumbs_list_frame >li:visible').length))
|
||||
$('#wrapResetImages').hide('slow');
|
||||
}
|
||||
|
||||
var thumb_width = $('#thumbs_list_frame >li').width() + parseInt($('#thumbs_list_frame >li').css('marginRight'));
|
||||
$('#thumbs_list_frame').width((parseInt((thumb_width) * $('#thumbs_list_frame >li').length)) + 'px');
|
||||
$('#thumbs_list').trigger('goto', 0);
|
||||
serialScrollFixLock('', '', '', '', 0);// SerialScroll Bug on goto 0 ?
|
||||
}
|
||||
@@ -548,6 +557,12 @@ $(document).ready(function()
|
||||
$('#customizedDatas').append(uploading_in_progress);
|
||||
});
|
||||
|
||||
original_url = window.location + '';
|
||||
first_url_check = true;
|
||||
bigpicSrc = $('#bigpic').attr('src');
|
||||
checkUrl();
|
||||
initLocationChange();
|
||||
|
||||
//init the price in relation of the selected attributes
|
||||
if (typeof productHasAttributes != 'undefined' && productHasAttributes)
|
||||
findCombination(true);
|
||||
@@ -563,11 +578,6 @@ $(document).ready(function()
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
});
|
||||
original_url = window.location + '';
|
||||
first_url_check = true;
|
||||
checkUrl();
|
||||
initLocationChange();
|
||||
|
||||
});
|
||||
|
||||
function saveCustomization()
|
||||
@@ -668,12 +678,12 @@ function getProductAttribute()
|
||||
function initLocationChange(time)
|
||||
{
|
||||
if(!time) time = 500;
|
||||
setInterval(checkUrl, time);
|
||||
setInterval(checkUrl, time);
|
||||
}
|
||||
|
||||
function checkUrl()
|
||||
{
|
||||
if (original_url != window.url || first_url_check)
|
||||
if (original_url != window.location || first_url_check)
|
||||
{
|
||||
first_url_check = false;
|
||||
url = window.location + '';
|
||||
@@ -710,11 +720,11 @@ function checkUrl()
|
||||
if (count >= 0)
|
||||
{
|
||||
findCombination(false);
|
||||
original_url = window.location + '';
|
||||
original_url = url;
|
||||
}
|
||||
// no combination found = removing attributes from url
|
||||
else
|
||||
window.location = url.substring(0, url.indexOf('#'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
{assign var=imageIds value="`$product->id`-`$image.id_image`"}
|
||||
<li id="thumbnail_{$image.id_image}">
|
||||
<a href="{$link->getImageLink($product->link_rewrite, $imageIds, thickbox_default)}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">
|
||||
<img class="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
|
||||
<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
@@ -285,7 +285,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
{assign var="groupName" value="group_$id_attribute_group"}
|
||||
<div class="attribute_list">
|
||||
{if ($group.group_type == 'select')}
|
||||
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
|
||||
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();">
|
||||
{foreach from=$group.attributes key=id_attribute item=group_attribute}
|
||||
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
@@ -295,9 +295,9 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
{assign var="default_colorpicker" value=""}
|
||||
{foreach from=$group.attributes key=id_attribute item=group_attribute}
|
||||
<li{if $group.default == $id_attribute} class="selected"{/if}>
|
||||
<a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}">
|
||||
<a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();">
|
||||
{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
|
||||
<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br>
|
||||
<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br />
|
||||
{/if}
|
||||
</a>
|
||||
</li>
|
||||
@@ -311,7 +311,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
<ul>
|
||||
{foreach from=$group.attributes key=id_attribute item=group_attribute}
|
||||
<li>
|
||||
<input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}">
|
||||
<input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();" />
|
||||
<span>{$group_attribute|escape:'htmlall':'UTF-8'}</span>
|
||||
</li>
|
||||
{/foreach}
|
||||
@@ -613,7 +613,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
{if $field.type == 1}
|
||||
<li class="customizationUploadLine{if $field.required} required{/if}">
|
||||
<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
|
||||
<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
|
||||
<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
|
||||
</li>
|
||||
{counter}
|
||||
{/if}
|
||||
@@ -636,13 +636,10 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($packItems) && $packItems|@count > 0}
|
||||
<div id="blockpack">
|
||||
<h2>{l s='Pack content'}</h2>
|
||||
{include file="$tpl_dir./product-list.tpl" products=$packItems}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
Reference in new issue
Block a user