Ignore:
Timestamp:
Oct 14, 2014, 9:25:41 PM (10 years ago)
Author:
rvelices
Message:

Fotorama use segmented views for large number of items
do not load plugin language and register event if not required
add event to allow video plugins to fill thumbnail.video and thumbnail.video_id (Fotorama can show youtube/vimeo videos during slideshow)

File:
1 edited

Legend:

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

    r29984 r30052  
    3434    if (history.replaceState)
    3535      history.replaceState(null, null, fotorama.activeFrame['url']+(fotorama.activeFrame['url'].indexOf('?')==-1 ? '?' : '&')+'slideshow=');
    36     jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
     36    jQuery('#slideshow .browsePath a,a.fotorama__close-icon').attr('href', fotorama.activeFrame['url']);
    3737    {/if}
    3838
     
    4040
    4141    jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
    42     jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
     42                var idx = fotorama.activeIndex;
     43{if isset($view_offset)}
     44                if (idx >= {$view_offset.from})
     45                        idx += {$view_offset.offset};
     46{/if}
     47    jQuery('#slideshow .imageNumber').text((idx+1)+'/{$TOTAL_ITEMS}');
    4348    document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
    4449  }
     
    4853    jQuery('.fotorama')
    4954        // Listen to the events
    50         .on('fotorama:showend ',
     55        .on('fotorama:showend',
    5156            function (e, fotorama, extra) {
    5257              if (!fullscreen) {
    5358                update_picture(fotorama);
    5459              }
     60                                                        {if !empty($view_borders)}
     61{if $view_borders[0] < $view_borders[1]}
     62                                                                if (fotorama.activeIndex <= {$view_borders[0]}{if $Fotorama_has_thumbs}+5{/if} ||
     63                                                                        fotorama.activeIndex >= {$view_borders[1]}{if $Fotorama_has_thumbs}-5{/if} )
     64{else}
     65                                                                if (fotorama.activeIndex <= {$view_borders[0]}{if $Fotorama_has_thumbs}+5{/if} &&
     66                                                                        fotorama.activeIndex >= {$view_borders[1]}{if $Fotorama_has_thumbs}-5{/if} )
     67{/if}
     68                                                                {
     69                                                                        fotorama.stopAutoplay();
     70                                                                        var url = fotorama.activeFrame.url + (fotorama.activeFrame.url.indexOf('?')==-1 ? '?' : '&')+'slideshow=';
     71{if !$Fotorama.only_fullscreen}
     72                                                                        if (fullscreen) url += "&fullscreen";
     73{/if}
     74                                                                        window.location = url;
     75                                                                }
     76                                                        {/if}
    5577            }
    5678        )
     
    108130{/if}
    109131url: "{$thumbnail.url}"
     132{if !empty($thumbnail.video)}
     133,video:"{$thumbnail.video}"{if !empty($thumbnail.video_id)},id:"{$thumbnail.video_id}"{/if}
     134{/if}
    110135},{/foreach}
    111136          ]
     
    121146      jQuery('html,body').animate({ scrollTop: jQuery('.fotorama').offset().top }, 'slow');
    122147      {/if}
     148                        {if isset($smarty.get.fullscreen)}
     149                        jQuery('.fotorama').data('fotorama').requestFullScreen();
     150                        {/if}
    123151    {/if}
    124152 
Note: See TracChangeset for help on using the changeset viewer.