OLD | NEW |
| (Empty) |
1 <!-- | |
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 | |
4 found in the LICENSE file. | |
5 --> | |
6 | |
7 <link rel="import" href="ct-commit.html"> | |
8 <link rel="import" href="ct-detailed-commit.html"> | |
9 <link rel="import" href="../bower_components/paper-button/paper-button.html"> | |
10 | |
11 <polymer-element name="ct-commit-list" attributes="commitList detailed"> | |
12 <template> | |
13 <style> | |
14 :host { | |
15 display: block; | |
16 } | |
17 paper-icon-button { | |
18 vertical-align: middle; | |
19 } | |
20 paper-icon-button::shadow #icon { | |
21 margin: 0px; | |
22 } | |
23 .repository-info { | |
24 display: block; | |
25 margin-bottom: 10px; | |
26 } | |
27 ct-commit { | |
28 margin-left: 10px; | |
29 } | |
30 </style> | |
31 <template repeat="{{ repository in commitList.repositories }}"> | |
32 <div class="repository-info"> | |
33 <span style="font-weight: bold">{{ repository.name }}</span> {{ reposito
ry.range }} | |
34 <paper-icon-button icon="unfold-more" | |
35 on-click="{{ _toggle }}" repository="{{ repository.name }}"></paper-
icon-button> | |
36 <template if="{{ repository.expanded }}"> | |
37 <template repeat="{{ commit in repository.commits }}"> | |
38 <template if="{{ !detailed }}"> | |
39 <ct-commit data="{{ commit }}"></ct-commit> | |
40 </template> | |
41 <template if="{{ detailed }}"> | |
42 <ct-detailed-commit data="{{ commit }}"></ct-detailed-commit> | |
43 </template> | |
44 </template> | |
45 </template> | |
46 </div> | |
47 </template> | |
48 </template> | |
49 <script> | |
50 Polymer({ | |
51 detailed: false, | |
52 _toggle: function(event, detail, sender, target) { | |
53 var repo = sender.getAttribute('repository'); | |
54 var r = this.commitList.repositories.find(function(item) { | |
55 return item.name === repo; | |
56 }); | |
57 r.expanded = !r.expanded; | |
58 } | |
59 }); | |
60 </script> | |
61 </polymer-element> | |
OLD | NEW |