| 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 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 }, | 64 }, |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Fires a custom event when the menu button is clicked. Sends the details | 67 * Fires a custom event when the menu button is clicked. Sends the details |
| 68 * of the history item and where the menu should appear. | 68 * of the history item and where the menu should appear. |
| 69 */ | 69 */ |
| 70 onMenuButtonTap_: function(e) { | 70 onMenuButtonTap_: function(e) { |
| 71 this.fire('toggle-menu', { | 71 this.fire('toggle-menu', { |
| 72 target: Polymer.dom(e).localTarget, | 72 target: Polymer.dom(e).localTarget, |
| 73 item: this.item, | 73 item: this.item, |
| 74 path: this.path, |
| 74 }); | 75 }); |
| 75 | 76 |
| 76 // Stops the 'tap' event from closing the menu when it opens. | 77 // Stops the 'tap' event from closing the menu when it opens. |
| 77 e.stopPropagation(); | 78 e.stopPropagation(); |
| 78 }, | 79 }, |
| 79 | 80 |
| 80 /** | 81 /** |
| 81 * Set the favicon image, based on the URL of the history item. | 82 * Set the favicon image, based on the URL of the history item. |
| 82 * @private | 83 * @private |
| 83 */ | 84 */ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 137 |
| 137 if (searchedTerm) | 138 if (searchedTerm) |
| 138 return currentItem.dateShort != nextItem.dateShort; | 139 return currentItem.dateShort != nextItem.dateShort; |
| 139 | 140 |
| 140 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 141 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
| 141 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 142 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 return { HistoryItem: HistoryItem }; | 145 return { HistoryItem: HistoryItem }; |
| 145 }); | 146 }); |
| OLD | NEW |