| 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', | |
| 7 | |
| 8 properties: { | |
| 9 // The date of these history items. | |
| 10 historyDate: { | |
| 11 type: String, | |
| 12 value: '' | |
| 13 }, | |
| 14 | |
| 15 // The list of history results that were accessed for a particular day in | |
| 16 // reverse chronological order. | |
| 17 historyItems: { | |
| 18 type: Array, | |
| 19 value: function() { return []; } | |
| 20 } | |
| 21 }, | |
| 22 | |
| 23 /** | |
| 24 * Check whether the time difference between the given historyItem and the | |
| 25 * next one is large enough for a spacer to be required. | |
| 26 * @param {number} index The index number of the first item being compared. | |
| 27 * @param {number} itemsLength The number of items on the card. Used to force | |
| 28 * needsTimeGap_ to run for every item if an item is deleted from the card. | |
| 29 * @return {boolean} Whether or not time gap separator is required. | |
| 30 * @private | |
| 31 */ | |
| 32 needsTimeGap_: function(index, itemsLength) { | |
| 33 var items = this.historyItems; | |
| 34 return index + 1 < items.length && | |
| 35 items[index].time - items[index + 1].time > BROWSING_GAP_TIME; | |
| 36 } | |
| 37 }); | |
| OLD | NEW |