From: Michael J. Rubinsky Date: Sat, 1 Jan 2011 21:40:08 +0000 (-0500) Subject: Don't reload the same gallery if requested twice in a row, clear the thumbs container X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c449a5af9a7af03bcfe5e617c00a78be8e93061c;p=horde.git Don't reload the same gallery if requested twice in a row, clear the thumbs container --- diff --git a/ansel/js/mobile.js b/ansel/js/mobile.js index 72c1d3fbc..d0173a6fc 100644 --- a/ansel/js/mobile.js +++ b/ansel/js/mobile.js @@ -13,6 +13,8 @@ */ var AnselMobile = { + currentGallery: null, + /** * Build a gallery list */ @@ -46,8 +48,14 @@ var AnselMobile = { */ galleryLoaded: function(r) { - $('#galleryview h1').text(r.n); // TODO: error checks, build any subgallery lists etc... + if (r.id == AnselMobile.currentGallery) { + $.mobile.changePage('galleryview', 'slide', false, true); + return; + } + AnselMobile.currentGallery = r.id; + $('#thumbs').text(''); + $('#galleryview h1').text(r.n); $.mobile.changePage('galleryview', 'slide', false, true); $.each(r.imgs, function(k, i) { var img = $('
  • ').append($('').attr({ src: i.url })); diff --git a/ansel/lib/Ajax/Application.php b/ansel/lib/Ajax/Application.php index 7cd096ec6..a47199dd3 100644 --- a/ansel/lib/Ajax/Application.php +++ b/ansel/lib/Ajax/Application.php @@ -25,6 +25,7 @@ class Ansel_Ajax_Application extends Horde_Core_Ajax_Application * @return mixed False on failure, object representing the gallery with * the following structure: *
    +     * 'id' - gallery id
          * 'n'  - gallery name
          * 'dc' - date created
          * 'dm' - date modified