bestprotop / jquery-multifile-plugin

Automatically exported from code.google.com/p/jquery-multifile-plugin
0 stars 0 forks source link

afterFileAppend always receives empty "value" parameter #189

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. bind event to afterFileAppend: function(element, value, master_element) {
2. add a file
3. "value" will be empty string

What is the expected output? What do you see instead?
"value" should be the file name of last added file.

What version of the plugin/jQuery are you using?
PLUGIN VERSION: 1.48
JQUERY VERSION: 1.9.1

On what browser(s) or operating system?
BROWSER(S): Chrome latest

Please provide a link to where the problem can be observed:
URL: -

Feel free to provide any additional information below.
My debugging guess:

This call triggers the event:
        //# Trigger Event! afterFileAppend
        if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
        //# End Event!

And that event tries to get "value" from the INPUT element:

var handler = MultiFile[event], value = $(element).attr('value');

But it might have been deleted by this line BEFORE the Trigger code:
$(MultiFile.current).reset().val('').attr('value', '')[0].value = '';

But I may be wrong. 

Original issue reported on code.google.com by lionkemp...@gmail.com on 10 Jan 2014 at 5:05