23 lines
		
	
	
		
			566 B
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			566 B
		
	
	
	
		
			HTML
		
	
	
	
<script>
 | 
						|
'use strict';
 | 
						|
window.Chat = window.Chat || {};
 | 
						|
Chat.FileSelectionBehavior = {
 | 
						|
    notifyFilesSelection: function(files) {
 | 
						|
        if (!files) {
 | 
						|
            console.log('no files selected...');
 | 
						|
            return;
 | 
						|
        }
 | 
						|
        this._fileSelected(files[0]); //single select
 | 
						|
        //files.forEach(this._fileSelected.bind(this)); //multi-select
 | 
						|
    },
 | 
						|
    _fileSelected: function(file) {
 | 
						|
        if (file) {
 | 
						|
            this.fire('file-selected', {
 | 
						|
                file: file,
 | 
						|
                name: file.name
 | 
						|
            });
 | 
						|
        }
 | 
						|
    }
 | 
						|
};
 | 
						|
</script>
 |