1 /** 2 * @author Gillis Haasnoot <gillis.haasnoot@gmail.com> 3 * @package Banana.Controls 4 * @summary File Input 5 */ 6 7 goog.provide('Banana.Controls.FileInput'); 8 9 /** @namespace Banana.Controls.FileInput*/ 10 namespace('Banana.Controls').FileInput = Banana.Controls.InputControl.extend({ 11 /** @lends Banana.Controls.FileInput.prototype */ 12 13 /** 14 * Creates file input control 15 * @constructs 16 * @extends Banana.Controls.InputControl 17 */ 18 init : function() 19 { 20 this._super(); 21 22 this.setAttribute("type",'file'); 23 }, 24 25 /** 26 * @param {boolean} bool 27 * @return {this} 28 */ 29 setMultiple : function(bool) 30 { 31 this.setAttribute("multiple",bool); 32 return this; 33 }, 34 35 /** 36 * @return {Array} of files 37 */ 38 getFiles : function() 39 { 40 var files = document.getElementById(this.getClientId()).files; 41 return files; 42 } 43 });