OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="ct-commit.html"> | 7 <link rel="import" href="ct-commit.html"> |
8 <link rel="import" href="../bower_components/paper-button/paper-button.html"> | 8 <link rel="import" href="../bower_components/paper-button/paper-button.html"> |
9 | 9 |
10 <polymer-element name="ct-commit-list" attributes="commitList"> | 10 <polymer-element name="ct-commit-list" attributes="commitList"> |
11 <template> | 11 <template> |
12 <style> | 12 <style> |
13 :host { | 13 :host { |
14 display: block; | 14 display: block; |
15 } | 15 } |
16 paper-icon-button { | 16 paper-icon-button { |
17 vertical-align: middle; | 17 vertical-align: middle; |
18 } | 18 } |
| 19 paper-icon-button::shadow #icon { |
| 20 margin: 0px; |
| 21 } |
19 .repository-info { | 22 .repository-info { |
20 display: block; | 23 display: block; |
| 24 margin-top: 10px; |
| 25 } |
| 26 ct-commit { |
| 27 margin-left: 10px; |
21 } | 28 } |
22 </style> | 29 </style> |
23 <template repeat="{{ repository in commitList.repositories }}"> | 30 <template repeat="{{ repository in commitList.repositories }}"> |
24 <div class="repository-info"> | 31 <div class="repository-info"> |
25 {{ repository.name }} {{ repository.range }} | 32 <span style="font-weight: bold">{{ repository.name }}</span> {{ reposito
ry.range }} |
26 <paper-icon-button icon="unfold-more" | 33 <paper-icon-button icon="unfold-more" |
27 on-click="{{ _toggle }}" repository="{{ repository.name }}"></paper-
icon-button> | 34 on-click="{{ _toggle }}" repository="{{ repository.name }}"></paper-
icon-button> |
28 <template if="{{ repository.expanded }}"> | 35 <template if="{{ repository.expanded }}"> |
29 <template repeat="{{ commit in repository.commits }}"> | 36 <template repeat="{{ commit in repository.commits }}"> |
30 <ct-commit data="{{ commit }}"></ct-commit> | 37 <ct-commit data="{{ commit }}"></ct-commit> |
31 </template> | 38 </template> |
32 </template> | 39 </template> |
33 </div> | 40 </div> |
34 </template> | 41 </template> |
35 </template> | 42 </template> |
36 <script> | 43 <script> |
37 Polymer({ | 44 Polymer({ |
38 _toggle: function(event, detail, sender, target) { | 45 _toggle: function(event, detail, sender, target) { |
39 var repo = sender.getAttribute('repository'); | 46 var repo = sender.getAttribute('repository'); |
40 var r = this.commitList.repositories.find(function(item) { | 47 var r = this.commitList.repositories.find(function(item) { |
41 return item.name === repo; | 48 return item.name === repo; |
42 }); | 49 }); |
43 r.expanded = !r.expanded; | 50 r.expanded = !r.expanded; |
44 } | 51 } |
45 }); | 52 }); |
46 </script> | 53 </script> |
47 </polymer-element> | 54 </polymer-element> |
OLD | NEW |