-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfile-fire.html
66 lines (56 loc) · 1.47 KB
/
file-fire.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="file-fire-behavior.html">
<dom-module id="file-fire">
<template>
<style>
:host {
display: block;
}
</style>
<template is="dom-if" if="{{showInputs}}">
<template is="dom-if" if="{{onlyImages}}">
<input type="file" id="filez" accept="image/*" on-change="_start">
</template>
<template is="dom-if" if="{{!onlyImages}}">
<input type="file" id="filez" on-change="_start">
</template>
</template>
</template>
<script>
/**
* An element that allows simple upload of an image to Firebase storage
* Example:
* ```
* <firebase-app
* name="demo"
* api-key="API_KEY"
* auth-domain="AUTH_DOMAIN"
* database-url="DATABASE_URL"
* storage-bucket="convoofire.appspot.com">
* </firebase-app>
* <!-- A file-fire element allowing image upload to firebase storage -->
* <file-fire
* path="/u/test"
* over-write
* max-size="500"
* progress="{{progress}}"
* ></file-fire>
* ```
*
*
* @demo demo/file-fire.html
*/
Polymer({
is: 'file-fire',
behaviors: [FileFireBehavior],
properties: {
srcUrl:{
type: String,
}
},
ready: function(){
if (this.srcUrl){this.showInputs = false} else {this.showInputs = true}
},
});
</script>
</dom-module>