forked from parth-r-patel/outpost-polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-search.html
33 lines (30 loc) · 1.19 KB
/
image-search.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
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-input/paper-input-decorator.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-toast/paper-toast.html">
<polymer-element name="pit-scouting">
<template>
<style id="style">
</style>
<paper-input-decorator id="decorator" label="Team" floatingLabel>
<input id="teamNumber" type="tel">
</paper-input-decorator>
<paper-button raised on-click="{{getImage}}">Get that Image Doe</paper-button>
<img src="{{url}}" id="image"/>
<paper-toast id="toast" text="{{msg}}" duration="3000"></paper-toast>
</template>
<script>
Polymer({
getImage: function (){
var team = this.$.teamNumber.value;
if (team !== ""){
this.url = "robotPhotos/" + team + ".jpg";
}
else {
this.msg = "Don't be dumb! Enter a Team Number";
this.$.toast.show();
}
}
});
</script>
</polymer-element>