Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop global var for uploads indexation #14418

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions js/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
cedric-anne marked this conversation as resolved.
Show resolved Hide resolved
var ext = file.name.split('.').pop();

var p = $('<p></p>')
Expand Down Expand Up @@ -169,8 +169,6 @@ var displayUploadedFile = function(file, tag, editor, input_name, filecontainer)
$('<span class="ti ti-circle-x pointer"></span>').click(function() {
deleteImagePasted(elementsIdToRemove, tag.tag, editor);
}).appendTo(p);

fileindex++;
};

/**
Expand Down