| 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) |
| 54 this.$['menu-button'].focus(); |
| 55 |
| 53 md_history.BrowserService.getInstance() | 56 md_history.BrowserService.getInstance() |
| 54 .removeBookmark(this.item.url); | 57 .removeBookmark(this.item.url); |
| 55 this.fire('remove-bookmark-stars', this.item.url); | 58 this.fire('remove-bookmark-stars', this.item.url); |
| 56 }, | 59 }, |
| 57 | 60 |
| 58 /** | 61 /** |
| 59 * Fires a custom event when the menu button is clicked. Sends the details | 62 * Fires a custom event when the menu button is clicked. Sends the details |
| 60 * of the history item and where the menu should appear. | 63 * of the history item and where the menu should appear. |
| 61 */ | 64 */ |
| 62 onMenuButtonTap_: function(e) { | 65 onMenuButtonTap_: function(e) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 131 |
| 129 if (searchedTerm) | 132 if (searchedTerm) |
| 130 return currentItem.dateShort != nextItem.dateShort; | 133 return currentItem.dateShort != nextItem.dateShort; |
| 131 | 134 |
| 132 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 135 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
| 133 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 136 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 return { HistoryItem: HistoryItem }; | 139 return { HistoryItem: HistoryItem }; |
| 137 }); | 140 }); |
| OLD | NEW |