plupload icon indicating copy to clipboard operation
plupload copied to clipboard

delete button is missing - plupload Queue

Open Matkill opened this issue 6 years ago • 4 comments

Hi,

I discovered a bug when i downloaded both versions : 2.3.6 and 3.1.2. With the plupload widget, if i add one file to the queue, the delete button icon does not appear.

On your demo page, if i'm looking the code there is a class on the "li" called "plupload_delete" but i don't have this class on the icon in the scripts i downloaded from your website.

If i'm looking the file jquery.plupload.queue.js to the line 224: fileList.append( '<li id="' + file.id + '">' + '<div class="plupload_file_name"><span>' + file.name + '</span></div>' + '<div class="plupload_file_action"><a href="#"></a></div>' + '<div class="plupload_file_status">' + file.percent + '%</div>' + '<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' + '<div class="plupload_clearer">&nbsp;</div>' + inputHTML + '</li>' );

and if i add: class="plupload_delete" after the id of the LI tag like this : fileList.append( '<li id="' + file.id + '" class="plupload_delete">' + '<div class="plupload_file_name"><span>' + file.name + '</span></div>' + '<div class="plupload_file_action"><a href="#"></a></div>' + '<div class="plupload_file_status">' + file.percent + '%</div>' + '<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' + '<div class="plupload_clearer">&nbsp;</div>' + inputHTML + '</li>' );

the delete icon appears when i add a file.

I don't know if this is a bug or not, sorry if it is not (maybe i've done a mistake somewhere ? )

Matkill avatar May 12 '18 20:05 Matkill

Hey, @Matkill, I've just noticed the same issue. You're right the li element doesn't appear to have the plupload_delete class.

roebuk avatar May 16 '18 13:05 roebuk

Hi, I could fix the problem by replacing file.status with file.state in the function called handleStatus at line 172. So at the end, code looks like this:

var actionClass;
if (file.state == plupload.DONE) {
	actionClass = 'plupload_done';
}
if (file.state == plupload.FAILED) {
	actionClass = 'plupload_failed';
}
if (file.state == plupload.QUEUED) {
		actionClass = 'plupload_delete';
}
if (file.state == plupload.UPLOADING) {
	actionClass = 'plupload_uploading';
}

onuryukselen avatar Jun 10 '19 18:06 onuryukselen

@onuryukselen , thanks for the solution. I don't understand why the owners/developers didn't do this simple fix, but your 'bug fix' worked for me.

khanks avatar Oct 14 '19 00:10 khanks

@onuryukselen Problem still present on 2021 LOL I confirm that your bug fix also worked for me Thank you !

Soufiane974 avatar Nov 25 '21 12:11 Soufiane974