PairDrop/app/elements/file-sharing/file-selection-behavior.html

23 lines
566 B
HTML
Raw Normal View History

2015-12-19 01:18:02 +01:00
<script>
'use strict';
window.Chat = window.Chat || {};
Chat.FileSelectionBehavior = {
notifyFilesSelection: function(files) {
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
//files.forEach(this._fileSelected.bind(this)); //multi-select
},
_fileSelected: function(file) {
if (file) {
this.fire('file-selected', {
file: file,
name: file.name
});
2015-12-19 01:18:02 +01:00
}
}
};
</script>