OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('md_history', function() { | 5 cr.define('md_history', function() { |
6 var HistoryItem = Polymer({ | 6 var HistoryItem = Polymer({ |
7 is: 'history-item', | 7 is: 'history-item', |
8 | 8 |
9 properties: { | 9 properties: { |
10 // Underlying HistoryEntry data for this item. Contains read-only fields | 10 // Underlying HistoryEntry data for this item. Contains read-only fields |
11 // from the history backend, as well as fields computed by history-list. | 11 // from the history backend, as well as fields computed by history-list. |
12 item: {type: Object, observer: 'showIcon_'}, | 12 item: {type: Object, observer: 'showIcon_'}, |
13 | 13 |
14 // Search term used to obtain this history-item. | 14 // Search term used to obtain this history-item. |
15 searchTerm: {type: String}, | 15 searchTerm: {type: String}, |
16 | 16 |
17 selected: {type: Boolean, reflectToAttribute: true}, | 17 selected: {type: Boolean, reflectToAttribute: true}, |
18 | 18 |
19 isFirstItem: {type: Boolean, reflectToAttribute: true}, | |
20 | |
21 isCardStart: {type: Boolean, reflectToAttribute: true}, | 19 isCardStart: {type: Boolean, reflectToAttribute: true}, |
22 | 20 |
23 isCardEnd: {type: Boolean, reflectToAttribute: true}, | 21 isCardEnd: {type: Boolean, reflectToAttribute: true}, |
24 | 22 |
25 // True if the item is being displayed embedded in another element and | 23 // True if the item is being displayed embedded in another element and |
26 // should not manage its own borders or size. | 24 // should not manage its own borders or size. |
27 embedded: {type: Boolean, reflectToAttribute: true}, | 25 embedded: {type: Boolean, reflectToAttribute: true}, |
28 | 26 |
29 hasTimeGap: {type: Boolean}, | 27 hasTimeGap: {type: Boolean}, |
30 | 28 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 189 |
192 if (searchedTerm) | 190 if (searchedTerm) |
193 return currentItem.dateShort != nextItem.dateShort; | 191 return currentItem.dateShort != nextItem.dateShort; |
194 | 192 |
195 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 193 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
196 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 194 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
197 }; | 195 }; |
198 | 196 |
199 return { HistoryItem: HistoryItem }; | 197 return { HistoryItem: HistoryItem }; |
200 }); | 198 }); |
OLD | NEW |