From 7126354d7abd0a7717f7958676bb5a110919cec7 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Sat, 13 Aug 2016 16:01:41 +0200 Subject: [PATCH] Hide "Photos" divider if photos are deleted. If we have deleted all photos from an album, we need to remove the divider between albums and photos. --- src/scripts/build.js | 4 ++-- src/scripts/view.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts/build.js b/src/scripts/build.js index 513f39b..bc8cff0 100644 --- a/src/scripts/build.js +++ b/src/scripts/build.js @@ -15,11 +15,11 @@ build.iconic = function(icon, classes = '') { } -build.divider = function(title) { +build.divider = function(title, id = '') { let html = '' - html += lychee.html`

$${ title }

` + html += lychee.html`

$${ title }

` return html diff --git a/src/scripts/view.js b/src/scripts/view.js index ad1c3b6..d8d8e67 100644 --- a/src/scripts/view.js +++ b/src/scripts/view.js @@ -158,7 +158,7 @@ view.album = { if (album.json.content && album.json.content!==false) { - photosData += build.divider('Photos') + photosData += build.divider('Photos', 'divider-photos') // Build photos $.each(album.json.content, function() { @@ -236,6 +236,7 @@ view.album = { if (!visible.albums()) { album.json.num-- view.album.num() + if (album.json.num == 0) $('#divider-photos').hide() } })