mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-27 18:26:16 -04:00
first full roundtrip
This commit is contained in:
parent
dd4809f519
commit
dc1af5ae7b
19 changed files with 222 additions and 450 deletions
34
app/elements/file-sharing/file-button-behavior.html
Normal file
34
app/elements/file-sharing/file-button-behavior.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<link rel="import" href="file-selection-behavior.html">
|
||||
<script>
|
||||
'use strict';
|
||||
window.Chat = window.Chat || {};
|
||||
Chat.FileButtonBehaviorImpl = {
|
||||
get fileInput() {
|
||||
var fileInput = Polymer.dom(this).querySelector('.fileInput');
|
||||
if (!fileInput) {
|
||||
fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
fileInput.className = 'fileInput';
|
||||
fileInput.style.position = 'fixed';
|
||||
fileInput.style.top = '-10000px';
|
||||
fileInput.style.left = '-10000px';
|
||||
fileInput.style.opacity = 0;
|
||||
Polymer.dom(this).appendChild(fileInput);
|
||||
}
|
||||
return fileInput;
|
||||
},
|
||||
attached: function() {
|
||||
this.fileInput.onchange = function() {
|
||||
var files = this.fileInput.files;
|
||||
this.notifyFilesSelection(files);
|
||||
}.bind(this);
|
||||
},
|
||||
listeners: {
|
||||
'tap': '_openDialog'
|
||||
},
|
||||
_openDialog: function() {
|
||||
this.fileInput.click();
|
||||
}
|
||||
};
|
||||
Chat.FileButtonBehavior = [Chat.FileButtonBehaviorImpl, Chat.FileSelectionBehavior];
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue