File tree Expand file tree Collapse file tree
GCDWebUploader/GCDWebUploader.bundle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ <h1>%header%</h1>
6565 < div id ="alerts "> </ div >
6666
6767 < div class ="btn-toolbar ">
68- < button type ="button " class ="btn btn-primary fileinput-button ">
68+ < button type ="button " class ="btn btn-primary fileinput-button " id =" upload-file " >
6969 < span class ="glyphicon glyphicon-upload "> </ span > Upload Files…
7070 < input id ="fileupload " type ="file " name ="files[] " multiple >
7171 </ button >
Original file line number Diff line number Diff line change @@ -178,6 +178,17 @@ function _reload(path) {
178178
179179$ ( document ) . ready ( function ( ) {
180180
181+ // Workaround Firefox and IE not showing file selection dialog when clicking on "upload-file" <button>
182+ // Making it a <div> instead also works but then it the button doesn't work anymore with tab selection or accessibility
183+ $ ( "#upload-file" ) . click ( function ( event ) {
184+ $ ( "#fileupload" ) . click ( ) ;
185+ } ) ;
186+
187+ // Prevent event bubbling when using workaround above
188+ $ ( "#fileupload" ) . click ( function ( event ) {
189+ event . stopPropagation ( ) ;
190+ } ) ;
191+
181192 $ ( "#fileupload" ) . fileupload ( {
182193 dropZone : $ ( document ) ,
183194 pasteZone : null ,
You can’t perform that action at this time.
0 commit comments