Skip to content
Permalink
Browse files

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.
  • Loading branch information...
plegall committed Sep 3, 2019
1 parent 5b65fca commit 1061dd0a7723f3520b571e49c3168d151e304ebb
Showing with 13 additions and 1 deletion.
  1. +13 −1 admin/themes/default/js/batchManagerGlobal.js
@@ -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') {

0 comments on commit 1061dd0

Please sign in to comment.
You can’t perform that action at this time.