Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 Polymer({ | |
| 6 is: 'history-card', | |
|
Dan Beam
2016/01/16 02:54:36
nit: \n
yingran
2016/01/18 05:40:29
Done.
| |
| 7 properties: { | |
| 8 // The date of these history items. | |
| 9 historyDate: { | |
| 10 type: String, | |
| 11 value: '' | |
| 12 }, | |
| 13 // The list of history results that were accessed for a particular day in | |
| 14 // reverse chronological order. | |
| 15 historyItems: { | |
| 16 type: Array, | |
| 17 value: [] | |
|
Dan Beam
2016/01/16 02:54:36
this should be:
value: function() { return [];
yingran
2016/01/18 05:40:29
Done.
| |
| 18 } | |
| 19 }, | |
| 20 | |
| 21 /** | |
| 22 * Check whether the time difference between the given historyItem and the | |
| 23 * next one is large enough for a spacer to be required. | |
| 24 * @param {number} index The index number of the first item being compared. | |
| 25 * @return {boolean} Whether or not time gap separator is required. | |
| 26 * @private | |
| 27 */ | |
| 28 needsTimeGap_: function(index) { | |
| 29 var items = this.historyItems; | |
| 30 return ((index + 1 < items.length) && | |
| 31 (items[index].time - items[index + 1].time > BROWSING_GAP_TIME)); | |
|
Dan Beam
2016/01/16 02:54:36
isn't this equivalent to
return index + 1 < items
yingran
2016/01/18 05:40:29
yep
| |
| 32 } | |
| 33 }); | |
| OLD | NEW |