2015-12-19 01:18:02 +01:00
|
|
|
<script>
|
|
|
|
'use strict';
|
|
|
|
window.Chat = window.Chat || {};
|
|
|
|
Chat.FileSelectionBehavior = {
|
|
|
|
notifyFilesSelection: function(files) {
|
2015-12-23 13:57:13 +01:00
|
|
|
if (!files) {
|
2015-12-19 01:18:02 +01:00
|
|
|
console.log('no files selected...');
|
|
|
|
return;
|
|
|
|
}
|
2015-12-26 13:33:16 +01:00
|
|
|
this._fileSelected(files[0]); //single select
|
|
|
|
},
|
|
|
|
_fileSelected: function(file) {
|
|
|
|
if (file) {
|
2015-12-23 13:57:13 +01:00
|
|
|
this.fire('file-selected', {
|
|
|
|
file: file,
|
|
|
|
name: file.name
|
|
|
|
});
|
2015-12-19 01:18:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|