fixes #1070 use ajax queue manager to launch metadata syncs

+ exit from event once the "metadata" is performed to avoid side effects with "delete" action.
This commit is contained in:
plegall
2019-09-03 16:49:12 +02:00
parent 5b65fca36c
commit 1061dd0a77
+13 -1
View File
@@ -224,11 +224,21 @@ jQuery('#applyAction').click(function(e) {
return true;
}
/* TODO "delete" and "metadata" algorithms are highly similar, they should be merged */
if (jQuery('[name="selectAction"]').val() == 'metadata') {
e.stopPropagation();
jQuery('.bulkAction').hide();
jQuery('#regenerationText').html(lang.syncProgressMessage);
var maxRequests=1;
var queuedManager = jQuery.manageAjax.create('queued', {
queue: true,
cacheResponse: false,
maxRequests: maxRequests
});
elements = Array();
if (jQuery('input[name=setSelected]').is(':checked')) {
@@ -265,7 +275,7 @@ jQuery('#applyAction').click(function(e) {
(function(ids) {
var thisBatchSize = ids.length;
jQuery.ajax({
queuedManager.add({
url: "ws.php?format=json&method=pwg.images.syncMetadata",
type:"POST",
dataType: "json",
@@ -291,6 +301,8 @@ jQuery('#applyAction').click(function(e) {
image_ids = Array();
}
return false;
}
if (jQuery('[name="selectAction"]').val() == 'delete') {