mirror of
https://github.com/jasny/bootstrap.git
synced 2026-01-22 20:57:58 -05:00
support ie8+ for changing target file
This commit is contained in:
11
js/bootstrap-fileupload.js
vendored
11
js/bootstrap-fileupload.js
vendored
@@ -91,7 +91,16 @@
|
||||
this.$hidden.val('')
|
||||
this.$hidden.attr('name', this.name)
|
||||
this.$input.attr('name', '')
|
||||
this.$input.val('') // Doesn't work in IE, which causes issues when selecting the same file twice
|
||||
|
||||
//ie8+ doesn't support changing the value of input with type=file so clone instead
|
||||
if($.browser.msie){
|
||||
var inputClone = this.$input.clone(true);
|
||||
this.$input.after(inputClone);
|
||||
this.$input.remove();
|
||||
this.$input = inputClone;
|
||||
}else{
|
||||
this.$input.val('')
|
||||
}
|
||||
|
||||
this.$preview.html('')
|
||||
this.$element.addClass('fileupload-new').removeClass('fileupload-exists')
|
||||
|
||||
Reference in New Issue
Block a user