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.
This commit is contained in:
Nils Asmussen 2016-08-13 16:01:41 +02:00
parent 58d3ad727d
commit 7126354d7a
2 changed files with 4 additions and 3 deletions

View File

@ -15,11 +15,11 @@ build.iconic = function(icon, classes = '') {
}
build.divider = function(title) {
build.divider = function(title, id = '') {
let html = ''
html += lychee.html`<div class='divider'><h1>$${ title }</h1></div>`
html += lychee.html`<div class='divider' id='$${ id }'><h1>$${ title }</h1></div>`
return html

View File

@ -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()
}
})