add confirmation modal and reload of albums after merge

This commit is contained in:
Rouven Hurling 2015-05-05 19:40:55 +02:00
parent 00b08fd22d
commit 2e71c71a28
2 changed files with 35 additions and 5 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -570,11 +570,41 @@ album.getArchive = function(albumID) {
}
album.merge = function(albumIDs) {
var params = {
albumIDs: albumIDs.join()
var action = {}
action.fn = function() {
var params;
basicModal.close();
params = {
albumIDs: albumIDs.join()
}
api.post('Album::merge', params, function(data) {
if (data!==true) {
lychee.error(null, params, data);
} else {
albums.json = null
albums.load()
}
})
}
api.post('Album::merge', params, function(data) {
if (data!==true) lychee.error(null, params, data);
})
basicModal.show({
body: '<p>Are you sure you want to merge all selected albums?</p>',
buttons: {
action: {
title: 'Merge Albums',
fn: action.fn,
class: 'red'
},
cancel: {
title: "Don't merge",
fn: basicModal.close
}
}
});
}