Skip to content
Newer
Older
100644 53 lines (50 sloc) 1.13 KB
cf52af5 @borismus Added todo list.
authored
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Todo Item Component</title>
5 </head>
6 <body>
7 <element name="todo-item" extends="li" constructor="TodoItem">
8 <template>
9 <style scoped>
10 * {
11 list-bullet-style: none;
12 }
13 :root {
14 padding: 12px 20px 11px 0;
15 position: relative;
16 font-size: 24px;
17 line-height: 1.1em;
18 border-bottom: 1px solid #cccccc;
19 }
20 :root:after {
21 content: "\0020";
22 display: block;
23 height: 0;
24 clear: both;
25 overflow: hidden;
26 visibility: hidden;
27 }
28 </style>
29
30 <div class="todo">
31 <div class="display">
32 <input class="check" type="checkbox">
33 <label class="todo-content"><content></content></label>
34 <span class="todo-destroy"></span>
35 </div>
36 </div>
37 </template>
38 <script>
39 var root = null;
40 this.lifecycle({
41 created: function(r) {
42 root = r;
43 },
44 });
45
46 TodoItem.prototype.setTitle = function(title) {
47 root.querySelector('.todo-content').innerText = title;
48 };
49 </script>
50 </element>
51 </body>
52 </html>
Something went wrong with that request. Please try again.