When binding a change directly to a file input just passthrough to the normal bind. A temporary fix for #5997, needs more investigation.

This commit is contained in:
jeresig 2010-02-13 04:40:26 -05:00
parent c1ac9fdf45
commit 467063a2e2
2 changed files with 13 additions and 0 deletions

View file

@ -769,6 +769,10 @@ if ( !jQuery.support.changeBubbles ) {
}, },
setup: function( data, namespaces ) { setup: function( data, namespaces ) {
if ( this.type === "file" ) {
return false;
}
for ( var type in changeFilters ) { for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
} }

View file

@ -52,6 +52,8 @@
<input type="radio" class="radio_test" name="myradio" id="radio3" disabled="disabled"/> <input type="radio" class="radio_test" name="myradio" id="radio3" disabled="disabled"/>
<label for="radio3">Radio3</label> <label for="radio3">Radio3</label>
</td> </td>
<td>
<input class="file_test" id="file1" type="file"/>
<td> <td>
<input class='test' value='' id='input' size='10' /> <input class='test' value='' id='input' size='10' />
<input class='test' value='test' id='input2' size='10' readonly="readonly" /> <input class='test' value='test' id='input2' size='10' readonly="readonly" />
@ -67,6 +69,7 @@
<td id='mselect' class="red">MULTI</td> <td id='mselect' class="red">MULTI</td>
<td id='checkbox' class="red">CHECKBOX</td> <td id='checkbox' class="red">CHECKBOX</td>
<td id='radio' class="red">RADIO</td> <td id='radio' class="red">RADIO</td>
<td id='file' class="red">FILE</td>
<td id='text' class="red">TEXT</td> <td id='text' class="red">TEXT</td>
<td id='textarea' class="red">TEXTAREA</td> <td id='textarea' class="red">TEXTAREA</td>
<td id='boundChange' class="red">DOCUMENT</td> <td id='boundChange' class="red">DOCUMENT</td>
@ -77,6 +80,7 @@
<td id='mselectbind' class="red">MULTI</td> <td id='mselectbind' class="red">MULTI</td>
<td id='checkboxbind' class="red">CHECKBOX</td> <td id='checkboxbind' class="red">CHECKBOX</td>
<td id='radiobind' class="red">RADIO</td> <td id='radiobind' class="red">RADIO</td>
<td id='filebind' class="red">FILE</td>
<td id='textbind' class="red">TEXT</td> <td id='textbind' class="red">TEXT</td>
<td id='textareabind' class="red">TEXTAREA</td> <td id='textareabind' class="red">TEXTAREA</td>
</tr> </tr>
@ -86,6 +90,7 @@
<td id='mselectfocus' class="red">MULTI</td> <td id='mselectfocus' class="red">MULTI</td>
<td id='checkboxfocus' class="red">CHECKBOX</td> <td id='checkboxfocus' class="red">CHECKBOX</td>
<td id='radiofocus' class="red">RADIO</td> <td id='radiofocus' class="red">RADIO</td>
<td id='filefocus' class="red">FILE</td>
<td id='textfocus' class="red">TEXT</td> <td id='textfocus' class="red">TEXT</td>
<td id='textareafocus' class="red">TEXTAREA</td> <td id='textareafocus' class="red">TEXTAREA</td>
<td id='boundFocus' class="red">DOCUMENT</td> <td id='boundFocus' class="red">DOCUMENT</td>
@ -96,6 +101,7 @@
<td id='mselectblur' class="red">MULTI</td> <td id='mselectblur' class="red">MULTI</td>
<td id='checkboxblur' class="red">CHECKBOX</td> <td id='checkboxblur' class="red">CHECKBOX</td>
<td id='radioblur' class="red">RADIO</td> <td id='radioblur' class="red">RADIO</td>
<td id='fileblur' class="red">FILE</td>
<td id='textblur' class="red">TEXT</td> <td id='textblur' class="red">TEXT</td>
<td id='textareablur' class="red">TEXTAREA</td> <td id='textareablur' class="red">TEXTAREA</td>
<td id='boundBlur' class="red">DOCUMENT</td> <td id='boundBlur' class="red">DOCUMENT</td>
@ -106,6 +112,7 @@
<td id='mselectlfocus' class="red">MULTI</td> <td id='mselectlfocus' class="red">MULTI</td>
<td id='checkboxlfocus' class="red">CHECKBOX</td> <td id='checkboxlfocus' class="red">CHECKBOX</td>
<td id='radiolfocus' class="red">RADIO</td> <td id='radiolfocus' class="red">RADIO</td>
<td id='filelfocus' class="red">FILE</td>
<td id='textlfocus' class="red">TEXT</td> <td id='textlfocus' class="red">TEXT</td>
<td id='textarealfocus' class="red">TEXTAREA</td> <td id='textarealfocus' class="red">TEXTAREA</td>
</tr> </tr>
@ -115,6 +122,7 @@
<td id='mselectlblur' class="red">MULTI</td> <td id='mselectlblur' class="red">MULTI</td>
<td id='checkboxlblur' class="red">CHECKBOX</td> <td id='checkboxlblur' class="red">CHECKBOX</td>
<td id='radiolblur' class="red">RADIO</td> <td id='radiolblur' class="red">RADIO</td>
<td id='filelblur' class="red">FILE</td>
<td id='textlblur' class="red">TEXT</td> <td id='textlblur' class="red">TEXT</td>
<td id='textarealblur' class="red">TEXTAREA</td> <td id='textarealblur' class="red">TEXTAREA</td>
</tr> </tr>
@ -215,6 +223,7 @@
$(".mselect_test").addChangeTest("#mselect"); $(".mselect_test").addChangeTest("#mselect");
$(".checkbox_test").addChangeTest("#checkbox"); $(".checkbox_test").addChangeTest("#checkbox");
$(".radio_test").addChangeTest("#radio"); $(".radio_test").addChangeTest("#radio");
$(".file_test").addChangeTest("#file");
$('textarea').addChangeTest("#textarea"); $('textarea').addChangeTest("#textarea");
$('#input').addChangeTest("#text"); $('#input').addChangeTest("#text");
$(document).bind("change", function(){ $(document).bind("change", function(){