PairDrop/app/elements/file-sharing/file-selection-behavior.html
2015-12-26 13:33:16 +01:00

22 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>