Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js |
— | — | @@ -243,22 +243,27 @@ |
244 | 244 | }, |
245 | 245 | |
246 | 246 | /** |
247 | | - * Get a list of the files, defaulting to the value from the input form |
248 | | - * @return Array of file objects |
| 247 | + * Get a list of the files from this file input, defaulting to the value from the input form |
| 248 | + * @return {Array} of File objects |
249 | 249 | */ |
250 | 250 | getFiles: function() { |
251 | 251 | var files = []; |
252 | | - if( this.providedFile && ! this.$fileInputCtrl.get(0).value ) { // default to the fileinput if it's defined. |
253 | | - files[0] = this.providedFile; |
254 | | - } else { |
255 | | - $j.each( this.$fileInputCtrl.get(0).files, function( i, file ) { |
256 | | - files.push( file ); |
257 | | - } ); |
| 252 | + if ( mw.fileApi.isAvailable() ) { |
| 253 | + if( this.providedFile && ! this.$fileInputCtrl.get(0).value ) { // default to the fileinput if it's defined. |
| 254 | + files[0] = this.providedFile; |
| 255 | + } else { |
| 256 | + $j.each( this.$fileInputCtrl.get(0).files, function( i, file ) { |
| 257 | + files.push( file ); |
| 258 | + } ); |
| 259 | + } |
258 | 260 | } |
259 | 261 | return files; |
260 | 262 | }, |
261 | 263 | |
262 | | - // get just the filename. |
| 264 | + /** |
| 265 | + * Get just the filename. |
| 266 | + * @return {String} |
| 267 | + */ |
263 | 268 | getFilename: function() { |
264 | 269 | if( this.providedFile && ! this.$fileInputCtrl.get(0).value ) { // default to the fileinput if it's defined. |
265 | 270 | return this.providedFile.fileName; |