aboutsummaryrefslogtreecommitdiffstats
path: root/themes/smartpocket/js/smartpocket.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/smartpocket/js/smartpocket.js')
-rw-r--r--themes/smartpocket/js/smartpocket.js21
1 files changed, 18 insertions, 3 deletions
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 '<div class="ps-toolbar-close"><div class="ps-toolbar-content"></div></div><div class="ps-toolbar-play"><div class="ps-toolbar-content"></div></div><a href="#" id="more_link">More Information</a><div class="ps-toolbar-previous"><div class="ps-toolbar-content"></div></div><div class="ps-toolbar-next"><div class="ps-toolbar-content"></div></div>';},
+ 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
+}
+