forked from MeredithU/polymer_checklist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrocery-item.html
49 lines (44 loc) · 952 Bytes
/
grocery-item.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
<link rel="import" href="bower_components/polymer/polymer.html">
<polymer-element name="grocery-item" attributes="show">
<template>
<style>
:host {
display: block;
position: relative;
background-color: #fff;
padding: 20px;
width: 50%;
}
polyfill-next-selector {
content: '.item h3';
}
.item ::content h3 {
margin: 0;
padding-left: 20px;
font-weight: 300;
}
:host([purchased]) ::content h3 {
text-decoration: line-through;
}
</style>
<div class="item" layout horizontal center>
<paper-checkbox on-tap="{{purchasedTapped}}"></paper-checkbox>
<content select="h3"></content>
</div>
<content></content>
</template>
<script>
Polymer('grocery-item', {
publish: {
purchased: {
value: false,
reflect: true
}
},
purchasedTapped: function(event, detail, sender) {
this.purchased = !this.purchased;
this.fire('purchased-tap');
}
});
</script>
</polymer-element>