Fixed an error when try to visit non-public albums
This commit is contained in:
parent
bd5394024b
commit
75d175b9cc
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user