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:
parent
58d3ad727d
commit
7126354d7a
@ -15,11 +15,11 @@ build.iconic = function(icon, classes = '') {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build.divider = function(title) {
|
build.divider = function(title, id = '') {
|
||||||
|
|
||||||
let html = ''
|
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
|
return html
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ view.album = {
|
|||||||
|
|
||||||
if (album.json.content && album.json.content!==false) {
|
if (album.json.content && album.json.content!==false) {
|
||||||
|
|
||||||
photosData += build.divider('Photos')
|
photosData += build.divider('Photos', 'divider-photos')
|
||||||
|
|
||||||
// Build photos
|
// Build photos
|
||||||
$.each(album.json.content, function() {
|
$.each(album.json.content, function() {
|
||||||
@ -236,6 +236,7 @@ view.album = {
|
|||||||
if (!visible.albums()) {
|
if (!visible.albums()) {
|
||||||
album.json.num--
|
album.json.num--
|
||||||
view.album.num()
|
view.album.num()
|
||||||
|
if (album.json.num == 0) $('#divider-photos').hide()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user