Changeset 29980


Ignore:
Timestamp:
Oct 10, 2014, 12:45:48 PM (10 years ago)
Author:
JanisV
Message:

Move Fotorama data initiaization to JS code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Fotorama/template/fotorama-content.tpl

    r29978 r29980  
    1717  data-thumbwidth="{$Fotorama.thumbheight}"{if $Fotorama.clicktransition_crossfade} data-clicktransition="crossfade"{/if}
    1818  data-keyboard="true">
    19 {foreach from=$items item=thumbnail}
    20   <a href="{$thumbnail.derivative->get_url()}"
    21     data-full="{$thumbnail.derivative_big->get_url()}" data-url="{$thumbnail.url}" data-caption="{$thumbnail.TITLE|escape:html}"
    22     {if $Fotorama_has_thumbs}data-thumb="{$thumbnail.derivative_thumb->get_url()}"{/if}>
    23     {if $Fotorama_has_thumbs}
    24       {assign var=thumb_size value=$thumbnail.derivative_thumb->get_size()}
    25       {if !$Fotorama.square_thumb}<img width="{$thumb_size[0]}" height="{$thumb_size[1]}">{/if}
    26     {/if}
    27   </a>
    28 {/foreach}
    2919</div>
    3020
     
    10898        )
    10999        // Initialize fotorama manually
    110         .fotorama();
     100        .fotorama({
     101          data: [
     102{foreach from=$items item=thumbnail}
     103{
     104caption: "{$thumbnail.TITLE|escape:javascript}",
     105full: "{str_replace('&amp;', '&', $thumbnail.derivative_big->get_url())}",
     106img: "{str_replace('&amp;', '&', $thumbnail.derivative->get_url())}",
     107{if $Fotorama_has_thumbs}
     108thumb: "{$thumbnail.derivative_thumb->get_url()}",
     109{assign var=thumb_size value=$thumbnail.derivative_thumb->get_size()}
     110thumbratio: {$thumb_size[0]/$thumb_size[1]},
     111{/if}
     112url: "{$thumbnail.url}"
     113},{/foreach}
     114          ]
     115        });
    111116
    112117    {if $Fotorama.only_fullscreen}
Note: See TracChangeset for help on using the changeset viewer.