From 41a9863e16c244b9a2c73440d0ca491fa101abe5 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Fri, 25 Nov 2011 08:48:04 +0100 Subject: [PATCH] fix so only Grid mode is supported if album does not contain any images --- icons/pear.css | 7 +++---- js/pear.js | 18 +++++++++--------- views/page.html.php | 9 +++------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/icons/pear.css b/icons/pear.css index 548a17fe..0f167644 100644 --- a/icons/pear.css +++ b/icons/pear.css @@ -350,14 +350,13 @@ font-weight: bold; .vs-icon-slideshow { background-position: -60px 0px; } .hover-with-viewSwitcher .vs-icon-slideshow, .sel-with-viewSwitcher .vs-icon-slideshow { background-position: -60px -15px; } -#viewControls .viewSwitcher:hover, #viewControls .sel-with-viewSwitcher, #viewControls .hover-with-viewSwitcher { +#viewControls .sel-with-viewSwitcher, #viewControls .hover-with-viewSwitcher { color: #ffffff; } -#viewControls .sel-with-viewSwitcher { - cursor: default; +#viewControls .sel-with-viewSwitcher, #viewControls .disabled { + cursor: default !important; } - /************************ DETAIL VIEW **************************/ #detailView { diff --git a/js/pear.js b/js/pear.js index e462a13a..b553b8bc 100644 --- a/js/pear.js +++ b/js/pear.js @@ -463,7 +463,6 @@ function bodyLoad(vm, bgcolor) { if (!$('#mosaicGridContainer').length) { $('#loading').hide(); maxSize = 0; return; } //Set event for Thumb Click. $('.p-photo').each(function (index) { $(this).click(function () { if (mosaicView) { swatchImg(index); } else {focusImage(index); } }); }); - $('#slideshow').click(function () { startSlideshow(); }); $('#mosaicDetail').click(function () { focusImage(currentImg); }); $('#prev_detail').click(function () { swatchImg(currentImg - 1); }); $('#next_detail').click(function () { swatchImg(currentImg + 1); }); @@ -540,14 +539,15 @@ function bodyLoad(vm, bgcolor) { $("#g-place-holder").remove(); } ); - $(".viewSwitcher").hover( - function() { - $(this).addClass("hover-with-viewSwitcher"); - }, - function() { - $(this).removeClass("hover-with-viewSwitcher"); - } - ); + if (slideshowImages.length !== 0) { + $(".viewSwitcher").hover( function() { $(this).addClass("hover-with-viewSwitcher"); }, function() { $(this).removeClass("hover-with-viewSwitcher"); }); + $("#grid").click(function () { switchToGrid(true); }); + $("#mosaic").click(function () { switchToMosaic(true); }); + $("#carousel").click(function () { startImageFlow(true); }); + $('#slideshow').click(function () { startSlideshow(); }); + } else { + $("#grid, #mosaic, #carousel, #slideshow").addClass("disabled"); + } } function preFetch() { diff --git a/views/page.html.php b/views/page.html.php index a582df65..dc6ab486 100644 --- a/views/page.html.php +++ b/views/page.html.php @@ -169,19 +169,16 @@
page_subtype != "movie"): ?> -
+
Grid
-
- +
Mosaic
-