Fixed an error when try to visit non-public albums

This commit is contained in:
Tobias Reich 2014-02-14 19:03:26 +01:00
parent bd5394024b
commit 75d175b9cc
3 changed files with 11 additions and 3 deletions

View File

@ -46,7 +46,14 @@ album = {
lychee.api(params, function(data) {
if (data==="Warning: Album private!") {
lychee.setMode("view");
if (document.location.hash.replace("#", "").split("/")[1]!=undefined) {
// Display photo only
lychee.setMode("view");
} else {
// Album not public
lychee.content.show();
lychee.goto("");
}
return false;
}

View File

@ -257,6 +257,7 @@ var lychee = {
Mousetrap.unbind('esc');
$("#button_back, a#next, a#previous").remove();
$(".no_content").remove();
lychee.publicMode = true;
lychee.viewMode = true;

View File

@ -458,8 +458,8 @@ view = {
lychee.imageview.html(build.imageview(photo.json, photo.isSmall(), visible.controls()));
if ((album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==="")||lychee.viewMode) $("a#next").hide();
if ((album.json&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==="")||lychee.viewMode) $("a#previous").hide();
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].nextPhoto==="")||lychee.viewMode) $("a#next").hide();
if ((album.json&&album.json.content&&album.json.content[photo.getID()]&&album.json.content[photo.getID()].previousPhoto==="")||lychee.viewMode) $("a#previous").hide();
},