Fixed error when using "Merge All" with one selected album
This commit is contained in:
parent
a73d008797
commit
d32115333e
BIN
dist/main.js
vendored
Executable file → Normal file
BIN
dist/main.js
vendored
Executable file → Normal file
Binary file not shown.
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user