Simplified view.photo.photo and only call and save photo.getID() once
This commit is contained in:
parent
14e808020a
commit
e6059dbd32
@ -406,27 +406,28 @@ view.photo = {
|
||||
|
||||
photo: function() {
|
||||
|
||||
lychee.imageview.html(build.imageview(photo.json, photo.getSize(), visible.header()))
|
||||
lychee.imageview.html(build.imageview(photo.json, visible.header()))
|
||||
|
||||
let $nextArrow = lychee.imageview.find('a#next'),
|
||||
$previousArrow = lychee.imageview.find('a#previous'),
|
||||
hasNext = album.json && album.json.content && album.json.content[photo.getID()] && album.json.content[photo.getID()].nextPhoto==='',
|
||||
hasPrevious = album.json && album.json.content && album.json.content[photo.getID()] && album.json.content[photo.getID()].previousPhoto===''
|
||||
photoID = photo.getID(),
|
||||
hasNext = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].nextPhoto!=='',
|
||||
hasPrevious = album.json && album.json.content && album.json.content[photoID] && album.json.content[photoID].previousPhoto!==''
|
||||
|
||||
if (hasNext || lychee.viewMode) { $nextArrow.hide() }
|
||||
if (hasNext===false || lychee.viewMode===true) { $nextArrow.hide() }
|
||||
else {
|
||||
|
||||
let nextPhotoID = album.json.content[photo.getID()].nextPhoto,
|
||||
let nextPhotoID = album.json.content[photoID].nextPhoto,
|
||||
nextPhoto = album.json.content[nextPhotoID]
|
||||
|
||||
$nextArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ nextPhoto.thumbUrl }")`)
|
||||
|
||||
}
|
||||
|
||||
if (hasPrevious || lychee.viewMode) { $previousArrow.hide() }
|
||||
if (hasPrevious===false || lychee.viewMode===true) { $previousArrow.hide() }
|
||||
else {
|
||||
|
||||
let previousPhotoID = album.json.content[photo.getID()].previousPhoto,
|
||||
let previousPhotoID = album.json.content[photoID].previousPhoto,
|
||||
previousPhoto = album.json.content[previousPhotoID]
|
||||
|
||||
$previousArrow.css('background-image', lychee.html`linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$${ previousPhoto.thumbUrl }")`)
|
||||
|
Loading…
Reference in New Issue
Block a user