Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 this.fire('history-checkbox-select', { | 43 this.fire('history-checkbox-select', { |
| 44 countAddition: this.$.checkbox.checked ? 1 : -1 | 44 countAddition: this.$.checkbox.checked ? 1 : -1 |
| 45 }); | 45 }); |
| 46 }, | 46 }, |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Remove bookmark of current item when bookmark-star is clicked. | 49 * Remove bookmark of current item when bookmark-star is clicked. |
| 50 * @private | 50 * @private |
| 51 */ | 51 */ |
| 52 onRemoveBookmarkTap_: function() { | 52 onRemoveBookmarkTap_: function() { |
| 53 if (this.$['bookmark-star'] == this.root.activeElement) { | |
|
tsergeant
2016/07/15 04:50:01
Nit: Remove {}
lshang
2016/07/19 07:55:10
Done.
| |
| 54 this.$['menu-button'].focus(); | |
| 55 } | |
| 56 | |
| 53 md_history.BrowserService.getInstance() | 57 md_history.BrowserService.getInstance() |
| 54 .removeBookmark(this.item.url); | 58 .removeBookmark(this.item.url); |
| 55 this.fire('remove-bookmark-stars', this.item.url); | 59 this.fire('remove-bookmark-stars', this.item.url); |
| 56 }, | 60 }, |
| 57 | 61 |
| 58 /** | 62 /** |
| 59 * Fires a custom event when the menu button is clicked. Sends the details | 63 * Fires a custom event when the menu button is clicked. Sends the details |
| 60 * of the history item and where the menu should appear. | 64 * of the history item and where the menu should appear. |
| 61 */ | 65 */ |
| 62 onMenuButtonTap_: function(e) { | 66 onMenuButtonTap_: function(e) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 132 |
| 129 if (searchedTerm) | 133 if (searchedTerm) |
| 130 return currentItem.dateShort != nextItem.dateShort; | 134 return currentItem.dateShort != nextItem.dateShort; |
| 131 | 135 |
| 132 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 136 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
| 133 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 137 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
| 134 }; | 138 }; |
| 135 | 139 |
| 136 return { HistoryItem: HistoryItem }; | 140 return { HistoryItem: HistoryItem }; |
| 137 }); | 141 }); |
| OLD | NEW |