[*] FO : Fix bug #PSCFV-10689 handle image legend

This commit is contained in:
gRoussac committed 2013-10-27 23:31:36 +01:00
1 parent 2dbaa5f73b
commit e1d1479f22
2 files changed
+19 -8

No files matched your search

+11 -5
View File
@@ -417,14 +417,20 @@ function displayImage(domAAroundImgThumb, no_animation)
{ {
if (typeof(no_animation) == 'undefined') if (typeof(no_animation) == 'undefined')
no_animation = false; no_animation = false;
if (domAAroundImgThumb.attr('href')) if (domAAroundImgThumb.prop('href'))
{ {
var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); var new_src = domAAroundImgThumb.prop('href').replace('thickbox', 'large');
if ($('#bigpic').attr('src') != newSrc) var new_title = domAAroundImgThumb.prop('title');
var new_href = domAAroundImgThumb.prop('href');
if ($('#bigpic').prop('src') != new_src)
{ {
$('#bigpic').attr('src', newSrc).load(function() { $('#bigpic').prop({
'src' : new_src,
'alt' : new_title,
'title' : new_title
}).load(function(){
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
$(this).attr('rel', domAAroundImgThumb.attr('href')); $(this).prop('rel', new_href);
}); });
} }
$('#views_block li a').removeClass('shown'); $('#views_block li a').removeClass('shown');
+8 -3
View File
@@ -183,7 +183,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
<div id="image-block"> <div id="image-block">
{if $have_image} {if $have_image}
<span id="view_full_size"> <span id="view_full_size">
<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html'}"{if $jqZoomEnabled && $have_image} class="jqzoom"{/if} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}"/> <img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html'}"{if $jqZoomEnabled && $have_image} class="jqzoom"{/if} title="{if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if}" id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}"/>
<span class="span_link">{l s='Maximize'}</span> <span class="span_link">{l s='Maximize'}</span>
</span> </span>
{else} {else}
@@ -202,9 +202,14 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
{if isset($images)} {if isset($images)}
{foreach from=$images item=image name=thumbnails} {foreach from=$images item=image name=thumbnails}
{assign var=imageIds value="`$product->id`-`$image.id_image`"} {assign var=imageIds value="`$product->id`-`$image.id_image`"}
{if !empty($image.legend)}
{assign var=imageTitlte value=$image.legend|escape:'htmlall':'UTF-8'}
{else}
{assign var=imageTitlte value=$product->name|escape:'htmlall':'UTF-8'}
{/if}
<li id="thumbnail_{$image.id_image}"> <li id="thumbnail_{$image.id_image}">
<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html'}" rel="other-views" class="thickbox{if $smarty.foreach.thumbnails.first} shown{/if}" title="{$image.legend|htmlspecialchars}"> <a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html'}" rel="other-views" class="thickbox{if $smarty.foreach.thumbnails.first} shown{/if}" title="{$imageTitlte}">
<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')|escape:'html'}" 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')|escape:'html'}" alt="{$imageTitlte}" title="{$imageTitlte}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
</a> </a>
</li> </li>
{/foreach} {/foreach}