From 4b07153f2e958fa1cff0f4ffeb0736f556065042 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Fri, 30 Sep 2011 14:12:02 +0200 Subject: [PATCH] Fix for carousel view via settings (and iron out some other bugs). --- admin/controllers/admin_theme_options.php | 2 +- js/pear.js | 15 +++++++-------- views/album.html.php | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/admin/controllers/admin_theme_options.php b/admin/controllers/admin_theme_options.php index 999334f1..cd784e24 100644 --- a/admin/controllers/admin_theme_options.php +++ b/admin/controllers/admin_theme_options.php @@ -87,7 +87,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller { ->checked(module::get_var("th_pear4gallery3", "hide_logo")); $group->dropdown("mainmenu_view") ->label(t("Main page View")) - ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"))) + ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"), "carousel" => t("Carousel"))) ->selected(module::get_var("th_pear4gallery3", "mainmenu_view")); $group->checkbox("show_guest_menu") ->label(t("Show Main Menu for Guest Users")) diff --git a/js/pear.js b/js/pear.js index 25daad9a..fbe01592 100644 --- a/js/pear.js +++ b/js/pear.js @@ -186,7 +186,6 @@ function mosaicResize() myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } - $('#pearFlowPadd').css({'height' : myHeight-87-(Math.round(myWidth / 2.4))+'px'}); if($('#imageflow').length != 0) $('#imageflow').css({'height': (myHeight-53)+'px', 'width': (((myWidth*0.5)<(myHeight-53)) ? myWidth : ((myHeight-65)*2)) +'px'}); $('#detailImageView').css({'height': myHeight-165+"px"}); @@ -195,8 +194,9 @@ function mosaicResize() $('#img_detail').css({'height': iHeight+"px", 'width':iWidth+"px"}); myWidth=myWidth-7; - ($('#paginator').length != 0) ? myHeight-=165: myHeight-=138; myHeight = myHeight - $('#g-site-status').outerHeight(true); + $('#pearFlowPadd').css({'height' : myHeight-90-(Math.round(myWidth / 2.4))+'px'}); + ($('#paginator').length != 0) ? myHeight-=165: myHeight-=138; $('#g-header').css('top', $('#gsNavBar').outerHeight(true)+$('#g-site-status').outerHeight(true)-4); if($('#g-movie').length) @@ -226,9 +226,7 @@ function bodyLoad(viewMode, bgcolor) { currentImg = parseInt(h.img); if(h.bgcolor != undefined) swatchSkin(h.bgcolor); - if(h.viewMode == 'detail') - focusImage(currentImg, h.redirected); - else + if(h.viewMode != undefined) viewMode = h.viewMode; /* end parse hash */ @@ -260,8 +258,6 @@ if(typeof slideshowImages != 'undefined') switch (viewMode) { case 'carousel': - startImageFlow(); - switchToMosaic(); startImageFlow(); break; case 'grid': @@ -270,6 +266,9 @@ if(typeof slideshowImages != 'undefined') case 'mosaic': switchToMosaic(); break; + case 'detail': + focusImage(currentImg, h.redirected); + break; default: mosaicResize(); checkCookie(); @@ -386,7 +385,7 @@ function startImageFlow() pearCarousel.init({ImageFlowID: 'pearImageFlow', aspectRatio: 2.4, imagesHeight: 0.6, opacity: true, reflections: false, startID: currentImg, onClick: function() {focusImage($(this).attr('longdesc'));}, startAnimation: true, xStep: 200, imageFocusM: 1.7, imageFocusMax: 4, opacityArray: [10, 9, 6, 2], percentOther: 130, captions: false, slider: false}); } switchMode('carousel'); - + mosaicResize(); } function setKeys() { diff --git a/views/album.html.php b/views/album.html.php index ec11ba4c..237fc3fd 100644 --- a/views/album.html.php +++ b/views/album.html.php @@ -96,5 +96,5 @@ endif; album_bottom() ?> paginator() ?> -
+