From 2bdee22bed6325ad2e9ed469f0dd90a0b104adcd Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 3 Jan 2011 13:24:00 -0500 Subject: [PATCH] Add back navigation for subgalleries. Now we correctly go back to the gallery's parent, if applicable, otherwise to the gallerylist --- ansel/js/mobile.js | 25 +++++++++++++++++++++++-- ansel/lib/Ajax/Application.php | 19 +------------------ ansel/lib/Gallery.php | 22 ++++++++++++++++++++++ ansel/templates/mobile/gallery.html.php | 1 + 4 files changed, 47 insertions(+), 20 deletions(-) diff --git a/ansel/js/mobile.js b/ansel/js/mobile.js index 6e55f5aa0..c5803b6b0 100644 --- a/ansel/js/mobile.js +++ b/ansel/js/mobile.js @@ -13,6 +13,11 @@ */ var AnselMobile = { + /** + * The currently displayed gallery + * + * @var object + */ currentGallery: null, /** @@ -65,14 +70,14 @@ var AnselMobile = { { // TODO: error checks, build any subgallery lists etc... if ($.mobile.currentPage != 'galleryview' && - AnselMobile.currentGallery && (r.id == AnselMobile.currentGallery)) { + AnselMobile.currentGallery && (r.id == AnselMobile.currentGallery.id)) { $.mobile.changePage('galleryview', 'slide', false, true); return; } //AnselMobile.imgs = r.imgs; - AnselMobile.currentGallery = r.id; + AnselMobile.currentGallery = r; if (r.sg.length) { var l = $('