Changeset 24514 for trunk/themes
- Timestamp:
- Sep 18, 2013, 6:36:27 PM (11 years ago)
- Location:
- trunk/themes/smartpocket
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/smartpocket/js/smartpocket.js
r23745 r24514 21 21 // onToolbarTap - listen out for when the toolbar is tapped 22 22 myPhotoSwipe.addEventHandler(PhotoSwipe.EventTypes.onToolbarTap, function(e){ 23 if (e.toolbarAction === PhotoSwipe.Toolbar.ToolbarAction.none){ 24 if (e.tapTarget === more_link || Util.DOM.isChildOf(e.tapTarget, more_link)){ 25 var currentImage = myPhotoSwipe.getCurrentImage(); 26 window.location=currentImage.metaData.picture_url; 27 } 28 } 29 }); $(document).bind('orientationchange', set_thumbnails_width); 30 set_thumbnails_width(); 23 if (e.toolbarAction === PhotoSwipe.Toolbar.ToolbarAction.none){ 24 if (e.tapTarget === more_link || Util.DOM.isChildOf(e.tapTarget, more_link)){ 25 var currentImage = myPhotoSwipe.getCurrentImage(); 26 window.location=currentImage.metaData.picture_url; 27 } 28 } 29 }); 30 $(window).bind('orientationchange', set_thumbnails_width); 31 set_thumbnails_width(); 31 32 }); 32 33 }(window, window.jQuery, window.Code.PhotoSwipe)); 33 34 34 35 function set_thumbnails_width() { 35 nb_thumbs = Math.max(3, Math.ceil($('.thumbnails').width() / 130)); 36 width = Math.floor(1000000 / nb_thumbs) / 10000; 37 $('.thumbnails li').css('width', width+'%'); 36 var dpr = window.devicePixelRatio>1 ? window.devicePixelRatio : 1 37 , nb_thumbs = Math.max(2, Math.ceil($('.thumbnails').width() / (var_thumb_width/dpr+2*5))) 38 , width = Math.floor(1000000 / nb_thumbs) / 10000; 39 $('.thumbnails li').css('width', width+'%'); 38 40 } 39 41 -
trunk/themes/smartpocket/template/thumbnails.tpl
r23718 r24514 6 6 {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} 7 7 {footer_script} 8 var var_loop = {if $smartpocket.loop}true{else}false{/if}, var_autohide = {$smartpocket.autohide}, var_trad = "{'More Information'|@translate}" ;8 var var_loop = {if $smartpocket.loop}true{else}false{/if}, var_autohide = {$smartpocket.autohide}, var_trad = "{'More Information'|@translate}", var_thumb_width={$thumbnail_derivative_params->max_width()}; 9 9 {/footer_script} 10 10
Note: See TracChangeset
for help on using the changeset viewer.