OLD | NEW |
---|---|
(Empty) | |
1 <link rel="import" href="chrome://resources/html/polymer.html"> | |
tsergeant
2016/05/19 05:38:18
Include-what-you-use iron-collapse and iron-icon.
calamity
2016/05/20 06:51:58
Done.
| |
2 <link rel="import" href="chrome://history/constants.html"> | |
3 <link rel="import" href="chrome://history/history_item.html"> | |
4 <link rel="import" href="chrome://history/shared_style.html"> | |
5 | |
6 <dom-module id="history-grouped-list"> | |
7 <template> | |
8 <style include="shared-style"> | |
9 :host { | |
10 align-items: center; | |
11 display: flex; | |
12 flex-direction: column; | |
13 overflow: auto; | |
14 position: relative; | |
15 } | |
16 | |
17 #main-container { | |
18 box-sizing: border-box; | |
19 max-width: var(--card-max-width); | |
20 min-width: var(--card-min-width); | |
21 padding: var(--first-card-padding-top) var(--card-padding-side); | |
22 width: 100%; | |
23 } | |
24 | |
25 .domain-heading { | |
26 align-items: center; | |
27 display: flex; | |
28 height: 40px; | |
29 padding: 0 20px; | |
30 } | |
31 | |
32 .domain-count { | |
33 color: rgb(151, 156, 160); | |
34 padding-left: 10px; | |
35 } | |
36 | |
37 .domain-heading-text { | |
38 display: flex; | |
39 } | |
40 | |
41 .group-container { | |
42 background: #fff; | |
43 border: 1px solid var(--card-border-color); | |
44 border-bottom-width: 2px; | |
45 margin-bottom: var(--card-padding-between); | |
46 max-width: var(--card-max-width); | |
47 min-width: var(--card-min-width); | |
48 width: 100%; | |
49 } | |
50 | |
51 .card-title { | |
52 margin-bottom: var(--card-first-last-item-padding); | |
53 } | |
54 | |
55 .domain-heading-text { | |
56 flex: 1 1 0; | |
57 } | |
58 | |
59 .dropdown-indicator { | |
60 max-width: 16px; | |
61 } | |
62 | |
63 history-item { | |
64 --border-style: none; | |
65 padding-left: 20px; | |
66 } | |
67 </style> | |
68 <div id="no-results" class="centered-message" | |
69 hidden$="{{hasResults(groupedHistoryData_.length)}}"> | |
tsergeant
2016/05/19 05:38:18
Nit: [[]] instead of {{}} where appropriate
calamity
2016/05/20 06:51:58
Done.
| |
70 {{noResultsMessage_(searchedTerm, querying)}} | |
71 </div> | |
72 <div id="main-container" | |
73 hidden$="{{!hasResults(groupedHistoryData_.length)}}"> | |
74 <template is="dom-repeat" items="[[groupedHistoryData_]]" as="group" | |
75 initial-count="1" index-as="groupIndex"> | |
76 <div class="group-container"> | |
77 <div class="card-title"> | |
78 <div> | |
tsergeant
2016/05/19 05:38:18
Is this inner div necessary?
calamity
2016/05/20 06:51:58
Removed.
| |
79 [[group.title]] | |
80 </div> | |
81 </div> | |
82 | |
83 <template is="dom-repeat" items="[[group.domains]]" as="domain" | |
84 initial-count="10" index-as="domainIndex"> | |
85 <div> | |
86 <div class="domain-heading" on-tap="toggleDomainExpanded_"> | |
87 <div class="domain-heading-text"> | |
88 <div class="website-icon" | |
89 style="[[getWebsiteIconStyle(domain)]]"></div> | |
90 <span>[[domain.domain]]</span> | |
91 <span class="domain-count">[[domain.visits.length]]</span> | |
92 </div> | |
93 <iron-icon icon="[[getDropdownIcon(domain.expanded)]]" | |
94 class="dropdown-indicator"></iron-icon> | |
95 </div> | |
96 <iron-collapse opened="{{domain.expanded}}" id="collapse"> | |
97 <div id="item-list"> | |
tsergeant
2016/05/19 05:38:18
Is -this- div necessary? It's not mentioned in the
calamity
2016/05/20 06:51:58
Oops. I was using this to play with collapse + dom
| |
98 <template is="dom-if" if="[[domain.rendered]]"> | |
99 <template is="dom-repeat" items="[[domain.visits]]" | |
100 as="item" initial-count="5" index-as="itemIndex"> | |
101 <history-item item="[[item]]" | |
102 starred="[[item.starred]]" | |
103 selected="{{item.selected}}" | |
104 has-time-gap="[[needsTimeGap_( | |
105 groupIndex, domainIndex, itemIndex)]]" | |
106 search-term="[[searchedTerm]]" | |
107 number-of-items="[[historyData.length]]"> | |
108 </history-item> | |
109 </template> | |
110 </template> | |
111 </div> | |
112 </iron-collapse> | |
113 </div> | |
114 </template> | |
115 </div> | |
116 </template> | |
117 </div> | |
118 </template> | |
119 <script src="chrome://history/grouped_list.js"></script> | |
120 </dom-module> | |
OLD | NEW |