21 lines
495 B
HTML
21 lines
495 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
|
|
},
|
|
_fileSelected: function(file) {
|
|
if (file) {
|
|
this.fire('file-selected', {
|
|
file: file,
|
|
name: file.name
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|