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