Fixed a missing JS variable when deleting a photo from the album's admin page. This also now just removes the photo element from the DOM instead of reloading the whole page. #150

This commit is contained in:
Andy Heathershaw 2020-04-22 08:18:30 +01:00
parent c1a11eee17
commit 132bfcdb83
1 changed files with 2 additions and 1 deletions

View File

@ -235,6 +235,7 @@ function EditPhotosViewModel(album_id, language, urls) {
deletePhoto: function (e) {
var self = this;
this.selectPhotoSingle(e.target);
var parent = $(e.target).closest('.photo');
var photo_id = self.photoIDs[0];
this.photoIDs = [];
@ -257,7 +258,7 @@ function EditPhotosViewModel(album_id, language, urls) {
$('.loading', parent).show();
$.post(url, {'_method': 'DELETE'}, function (data) {
window.location.reload();
$(parent).remove();
});
}
}