From 68844b8f7e26786d44fc48c769aa0449a7642ae4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 16 Apr 2013 23:15:18 -0400 Subject: [PATCH] add gallery to boxset page --- dashboard-ui/scripts/boxset.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dashboard-ui/scripts/boxset.js b/dashboard-ui/scripts/boxset.js index 8a35a84a79..6c2fe9fd4b 100644 --- a/dashboard-ui/scripts/boxset.js +++ b/dashboard-ui/scripts/boxset.js @@ -1,5 +1,7 @@ (function ($, document, LibraryBrowser) { + var currentItem; + function reload(page) { var id = getParameterByName('id'); @@ -8,6 +10,8 @@ ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { + currentItem = item; + var name = item.Name; $('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item)); @@ -18,6 +22,12 @@ renderDetails(page, item); + if (LibraryBrowser.shouldDisplayGallery(item)) { + $('#galleryCollapsible', page).show(); + } else { + $('#galleryCollapsible', page).hide(); + } + Dashboard.hideLoadingMsg(); }); } @@ -78,6 +88,13 @@ }); } + function renderGallery(page, item) { + + var html = LibraryBrowser.getGalleryHtml(item); + + $('#galleryContent', page).html(html).trigger('create'); + } + $(document).on('pageshow', "#boxsetPage", function () { var page = this; @@ -90,12 +107,20 @@ $(this).off('expand.lazyload'); }); + + $('#galleryCollapsible', page).on('expand.lazyload', function () { + + renderGallery(page, currentItem); + + $(this).off('expand.lazyload'); + }); }).on('pagehide', "#boxsetPage", function () { var page = this; $('#moviesCollapsible', page).off('expand.lazyload'); + $('#galleryCollapsible', page).off('expand.lazyload'); });