From 3e9d3ab6865dde6a9a8b2a7aa181703dc56f1abd Mon Sep 17 00:00:00 2001 From: flop25 Date: Sun, 30 Jun 2013 14:24:42 +0000 Subject: bug:2848 jquery.mobile updated photoswipe updated menubar is now a right panel, with almost all the usual links added comment, search, picture, about and tags pages ToDo: *bug correction of the link added to the photoswipe toolbar (link doesn't triggered) *display the calculated size on the picture page limitations: no calendar view git-svn-id: http://piwigo.org/svn/trunk@23713 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/smartpocket/js/smartpocket.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'themes/smartpocket/js/smartpocket.js') diff --git a/themes/smartpocket/js/smartpocket.js b/themes/smartpocket/js/smartpocket.js index ab7874453..0b076fcc0 100644 --- a/themes/smartpocket/js/smartpocket.js +++ b/themes/smartpocket/js/smartpocket.js @@ -2,10 +2,24 @@ $(document).ready(function(){ var options = { jQueryMobile: true, - imageScaleMethod: "fitNoUpscale" + captionAndToolbarAutoHideDelay: 0, + imageScaleMethod: "fitNoUpscale", + getToolbar: function(){ +return '
More Information
';}, + getImageMetaData:function(el){ + return { + picture_url: $(el).attr('data-picture-url') + };} }; - $(".thumbnails a").photoSwipe(options); + var myPhotoSwipe = $(".thumbnails a").photoSwipe(options); + myPhotoSwipe.addEventHandler(PhotoSwipe.EventTypes.onDisplayImage, function(e){ + var currentImage = myPhotoSwipe.getCurrentImage(); + $("#more_link").attr("href", currentImage.metaData.picture_url); + }); $(document).bind('orientationchange', set_thumbnails_width); + $("#more_link").click(function(){ + console.log($(this).attr('href')); + }); set_thumbnails_width(); }); }(window, window.jQuery, window.Code.PhotoSwipe)); @@ -14,4 +28,5 @@ function set_thumbnails_width() { nb_thumbs = Math.max(3, Math.ceil($('.thumbnails').width() / 130)); width = Math.floor(1000000 / nb_thumbs) / 10000; $('.thumbnails li').css('width', width+'%'); -} \ No newline at end of file +} + -- cgit v1.2.3