mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Workaround Firefox and IE not showing file selection dialog
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
<div id="alerts"></div>
|
<div id="alerts"></div>
|
||||||
|
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<button type="button" class="btn btn-primary fileinput-button">
|
<button type="button" class="btn btn-primary fileinput-button" id="upload-file">
|
||||||
<span class="glyphicon glyphicon-upload"></span> Upload Files…
|
<span class="glyphicon glyphicon-upload"></span> Upload Files…
|
||||||
<input id="fileupload" type="file" name="files[]" multiple>
|
<input id="fileupload" type="file" name="files[]" multiple>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -178,6 +178,17 @@ function _reload(path) {
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// Workaround Firefox and IE not showing file selection dialog when clicking on "upload-file" <button>
|
||||||
|
// Making it a <div> instead also works but then it the button doesn't work anymore with tab selection or accessibility
|
||||||
|
$("#upload-file").click(function(event) {
|
||||||
|
$("#fileupload").click();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prevent event bubbling when using workaround above
|
||||||
|
$("#fileupload").click(function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
$("#fileupload").fileupload({
|
$("#fileupload").fileupload({
|
||||||
dropZone: $(document),
|
dropZone: $(document),
|
||||||
pasteZone: null,
|
pasteZone: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user