Commit fb638fa3 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

probleme with multiple add ok

parent dd83df92
......@@ -216,6 +216,7 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
$("#workflow_form :checkbox").each(function(){
if (!$(this).prop('checked')) { params += $(this).attr("name") + "=false&"; }
});
$this.$element.on("uploaded", function() {
$.ajax({
url: $this.options.serverURL + '/run_workflow?' + params + 'callback=?',
......@@ -224,9 +225,19 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
$this.$element.trigger('run', running_wf);
}
});
});
});
$this.$element.trigger('uploading');
// submit the data of each fileupload
$(".fileupload").each(function(){
var tid = $(this).attr("id").split("_"),
iid = tid.slice(1, tid.length).join("_");
if ($("#"+iid).data("data2upload")) {
$("#"+iid).data("data2upload").submit();
}
});
// execute _uploadProgress to init the display
_uploadProgress($this);
// then loop to follow the file upload
......@@ -304,16 +315,15 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
// Initialize the jQuery File Upload widget:
$(".fileupload").each(function(){
var tid = $(this).attr("id").split("_"),
iid = tid.slice(1, tid.length).join("_");
iid = tid.slice(1, tid.length).join("_"),
$thisfu = $(this);
$this.uploadfiles[iid] = +new Date + "_" + Math.floor((Math.random()*10000)+1); ;
$(this).fileupload({
url: $this.options.serverURL + "/upload",
formData: {prefix: $this.uploadfiles[iid]},
forceIframeTransport: true,
add: function (e, data) {
$this.$element.on("uploading", function() {
data.submit();
});
$("#"+iid).data("data2upload", data);
}
});
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment