mirror of
https://github.com/jasny/bootstrap.git
synced 2026-01-21 04:17:53 -05:00
Fixes for bootstrap fileupload
- Fix for IE9- - Fix for click on dismiss button (befor init)
This commit is contained in:
6
docs/assets/js/bootstrap-fileupload.js
vendored
6
docs/assets/js/bootstrap-fileupload.js
vendored
@@ -56,7 +56,7 @@
|
||||
},
|
||||
|
||||
change: function(e, invoked) {
|
||||
var file = e.target.files[0]
|
||||
var file = e.target.files !== undefined ? e.target.files[0] : { name: e.target.value.replace(/^.+\\/, '') }
|
||||
if (!file || invoked === 'clear') return
|
||||
|
||||
this.$hidden.val('')
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
reader.readAsDataURL(file)
|
||||
} else {
|
||||
this.$preview.html(window.escape(file.name))
|
||||
this.$preview.text(file.name)
|
||||
this.$element.addClass('fileupload-exists').removeClass('fileupload-new')
|
||||
}
|
||||
},
|
||||
@@ -118,6 +118,8 @@
|
||||
var $this = $(this)
|
||||
if ($this.data('fileupload')) return
|
||||
$this.fileupload($this.data())
|
||||
|
||||
if ($(e.target).data('dismiss') == 'fileupload') $(e.target).trigger('click.fileupload')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
6
docs/assets/js/bootstrap.js
vendored
6
docs/assets/js/bootstrap.js
vendored
@@ -2311,7 +2311,7 @@
|
||||
},
|
||||
|
||||
change: function(e, invoked) {
|
||||
var file = e.target.files[0]
|
||||
var file = e.target.files !== undefined ? e.target.files[0] : { name: e.target.value.replace(/^.+\\/, '') }
|
||||
if (!file || invoked === 'clear') return
|
||||
|
||||
this.$hidden.val('')
|
||||
@@ -2330,7 +2330,7 @@
|
||||
|
||||
reader.readAsDataURL(file)
|
||||
} else {
|
||||
this.$preview.html(window.escape(file.name))
|
||||
this.$preview.text(file.name)
|
||||
this.$element.addClass('fileupload-exists').removeClass('fileupload-new')
|
||||
}
|
||||
},
|
||||
@@ -2373,6 +2373,8 @@
|
||||
var $this = $(this)
|
||||
if ($this.data('fileupload')) return
|
||||
$this.fileupload($this.data())
|
||||
|
||||
if ($(e.target).data('dismiss') == 'fileupload') $(e.target).trigger('click.fileupload')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -149,7 +149,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<h3><a href="./base-css.html#action-links">Iconic icons</a></h3>
|
||||
<h3><a href="./base-css.html#iconic">Iconic icons</a></h3>
|
||||
<p>The iconic font set adds 170 new icons to Bootstrap. These icons can be used with buttons, menus, links, etc.</p>
|
||||
<p>Because these icons are a font, they can be styled just like text.</p>
|
||||
</div>
|
||||
|
||||
8
js/bootstrap-fileupload.js
vendored
8
js/bootstrap-fileupload.js
vendored
@@ -1,5 +1,5 @@
|
||||
/* ===========================================================
|
||||
* bootstrap-fileupload.js j1
|
||||
* bootstrap-fileupload.js j1a
|
||||
* http://jasny.github.com/bootstrap/javascript.html#fileupload
|
||||
* ===========================================================
|
||||
* Copyright 2012 Jasny BV, Netherlands.
|
||||
@@ -56,7 +56,7 @@
|
||||
},
|
||||
|
||||
change: function(e, invoked) {
|
||||
var file = e.target.files[0]
|
||||
var file = e.target.files !== undefined ? e.target.files[0] : { name: e.target.value.replace(/^.+\\/, '') }
|
||||
if (!file || invoked === 'clear') return
|
||||
|
||||
this.$hidden.val('')
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
reader.readAsDataURL(file)
|
||||
} else {
|
||||
this.$preview.html(window.escape(file.name))
|
||||
this.$preview.text(file.name)
|
||||
this.$element.addClass('fileupload-exists').removeClass('fileupload-new')
|
||||
}
|
||||
},
|
||||
@@ -118,6 +118,8 @@
|
||||
var $this = $(this)
|
||||
if ($this.data('fileupload')) return
|
||||
$this.fileupload($this.data())
|
||||
|
||||
if ($(e.target).data('dismiss') == 'fileupload') $(e.target).trigger('click.fileupload')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user