Fixed error when using "Merge All" with one selected album

This commit is contained in:
Tobias Reich 2015-06-28 14:07:03 +02:00
parent a73d008797
commit d32115333e
2 changed files with 13 additions and 5 deletions

BIN
dist/main.js vendored Executable file → Normal file

Binary file not shown.

View File

@ -68,11 +68,19 @@ contextMenu.albumMulti = function(albumIDs, e) {
multiselect.stopResize(); multiselect.stopResize();
var items = [ var items = [];
{ type: 'item', title: build.iconic('pencil') + 'Rename All', fn: function() { album.setTitle(albumIDs) } },
{ type: 'item', title: build.iconic('collapse-left') + 'Merge All', fn: function () { album.merge(albumIDs) } }, items.push({ type: 'item', title: build.iconic('pencil') + 'Rename All', fn: function() { album.setTitle(albumIDs) } });
{ type: 'item', title: build.iconic('trash') + 'Delete All', fn: function() { album.delete(albumIDs) } }
]; // Automatically merge selected albums when albumIDs contains more than one album
// Show list of albums otherwise
if (albumIDs.length>1) items.push({ type: 'item', title: build.iconic('collapse-left') + 'Merge All', fn: function () { album.merge(albumIDs) } });
else items.push({ type: 'item', title: build.iconic('collapse-left') + 'Merge', fn: function () { basicContext.close(); contextMenu.mergeAlbum(albumIDs[0], e) } })
items.push({ type: 'item', title: build.iconic('trash') + 'Delete All', fn: function() { album.delete(albumIDs) } });
// Remove merge when there is only one album
if (albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length<=1) items.splice(1, 1);
basicContext.show(items, e.originalEvent, contextMenu.close); basicContext.show(items, e.originalEvent, contextMenu.close);