From 81e82d73c9bf795c5c67539fba1c13cef842dea2 Mon Sep 17 00:00:00 2001 From: ildyria Date: Thu, 28 Feb 2019 14:19:00 +0100 Subject: [PATCH] Fixes https://github.com/LycheeOrg/Lychee/issues/220 --- scripts/main/header.js | 4 ++-- scripts/main/photo.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/main/header.js b/scripts/main/header.js index 4059192e..d8da9a22 100644 --- a/scripts/main/header.js +++ b/scripts/main/header.js @@ -45,7 +45,7 @@ header.bind = function() { header.dom('#button_info') .on(eventName, sidebar.toggle); header.dom('.button_add') .on(eventName, contextMenu.add); header.dom('#button_more') .on(eventName, function(e) { contextMenu.photoMore(photo.getID(), e) }); - header.dom('#button_move') .on(eventName, function(e) { contextMenu.move([ photo.getID() ], e) }); + header.dom('#button_move') .on(eventName, function(e) { contextMenu.move([ photo.getID() ], e, photo.setAlbum) }); header.dom('.header__hostedwith') .on(eventName, function() { window.open(lychee.website) }); header.dom('#button_trash_album') .on(eventName, function() { album.delete([ album.getID() ]) }); header.dom('#button_trash') .on(eventName, function() { photo.delete([ photo.getID() ]) }); @@ -136,7 +136,7 @@ header.setMode = function(mode) { header.dom('.header__toolbar--album').addClass('header__toolbar--visible'); // Hide download button when album empty - if (album.json.photos===false) $('#button_archive').hide(); + if (!album.json || album.json.photos===false) $('#button_archive').hide(); else $('#button_archive').show(); // Hide download button when not logged in and album not downloadable diff --git a/scripts/main/photo.js b/scripts/main/photo.js index 02dec5f9..cd822df5 100644 --- a/scripts/main/photo.js +++ b/scripts/main/photo.js @@ -433,7 +433,7 @@ photo.setAlbum = function(photoIDs, albumID) { if (!photoIDs) return false; if (photoIDs instanceof Array===false) photoIDs = [ photoIDs ]; - photoIDs.forEach(function(id, index, array) { + photoIDs.forEach(function(id) { // Change reference for the next and previous photo if (album.getByID(id).nextPhoto!==''||album.getByID(id).previousPhoto!=='') { @@ -470,7 +470,7 @@ photo.setAlbum = function(photoIDs, albumID) { } else { - album.reload(); + if (visible.album()) album.reload(); } })