From 7429ef41c7f6097e014e3d1c89e2c127b714f224 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 30 Mar 2023 10:34:08 +0200 Subject: [PATCH] drop global var for uploads indexation --- js/fileupload.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/fileupload.js b/js/fileupload.js index d6fc93e9174..60473f9c268 100644 --- a/js/fileupload.js +++ b/js/fileupload.js @@ -130,8 +130,8 @@ var handleUploadedFile = function (files, files_data, input_name, container, edi * @param {String} input_name Name of generated input hidden (default filename) * @param {Object} container The fileinfo container */ -var fileindex = 0; var displayUploadedFile = function(file, tag, editor, input_name, filecontainer) { + var fileindex = $('input[name^="_'+input_name+'["]').length; var ext = file.name.split('.').pop(); var p = $('

') @@ -169,8 +169,6 @@ var displayUploadedFile = function(file, tag, editor, input_name, filecontainer) $('').click(function() { deleteImagePasted(elementsIdToRemove, tag.tag, editor); }).appendTo(p); - - fileindex++; }; /**