When deleting picture from album show next picture #242

This commit is contained in:
Tobias Reich 2014-10-18 17:36:49 +02:00
parent c0d2f4b5b8
commit 263eed3447
2 changed files with 8 additions and 6 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -53,7 +53,7 @@ photo = {
},
//preload the next photo for better response time
// Preload the next photo for better response time
preloadNext: function(photoID) {
var nextPhoto,
@ -185,8 +185,8 @@ photo = {
buttons = [
["", function() {
var nextPhoto,
previousPhoto;
var nextPhoto = "",
previousPhoto = "";
photoIDs.forEach(function(id, index, array) {
@ -206,11 +206,13 @@ photo = {
});
// Only when search is not active
if (!visible.albums()) lychee.goto(album.getID());
albums.refresh();
// Go to next photo if there is a next photo and
// next photo is not the current one. Show album otherwise.
if (visible.photo()&&nextPhoto!==""&&nextPhoto!==photo.getID()) lychee.goto(album.getID() + "/" + nextPhoto);
else if (!visible.albums()) lychee.goto(album.getID());
params = "deletePhoto&photoIDs=" + photoIDs;
lychee.api(params, function(data) {