From e1d1479f225b1b8f8230aeebac617eadc8eb8f66 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Sun, 27 Oct 2013 23:31:36 +0100 Subject: [PATCH] [*] FO : Fix bug #PSCFV-10689 handle image legend --- themes/default/js/product.js | 16 +++++++++++----- themes/default/product.tpl | 19 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 8e959b9ae..b38b63e38 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -417,14 +417,20 @@ function displayImage(domAAroundImgThumb, no_animation) { if (typeof(no_animation) == 'undefined') no_animation = false; - if (domAAroundImgThumb.attr('href')) + if (domAAroundImgThumb.prop('href')) { - var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); - if ($('#bigpic').attr('src') != newSrc) + var new_src = domAAroundImgThumb.prop('href').replace('thickbox', 'large'); + 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) - $(this).attr('rel', domAAroundImgThumb.attr('href')); + $(this).prop('rel', new_href); }); } $('#views_block li a').removeClass('shown'); diff --git a/themes/default/product.tpl b/themes/default/product.tpl index dfd32a4ae..8224f865f 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -183,7 +183,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
{if $have_image} - {$product->name|escape:'htmlall':'UTF-8'} + {if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if} {l s='Maximize'} {else} @@ -199,16 +199,21 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving {if isset($images) && count($images) > 3}{/if}
    - {if isset($images)} - {foreach from=$images item=image name=thumbnails} + {if isset($images)} + {foreach from=$images item=image name=thumbnails} {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}
  • - - {$image.legend|htmlspecialchars} + + {$imageTitlte}
  • - {/foreach} - {/if} + {/foreach} + {/if}
{if isset($images) && count($images) > 3}{l s='Next'}{/if}