Chromium Code Reviews| Index: chrome/browser/resources/md_history/history_card_manager.js |
| diff --git a/chrome/browser/resources/md_history/history_card_manager.js b/chrome/browser/resources/md_history/history_card_manager.js |
| index f7cd51bbc4fe2ba9f1dee84bb9218b79e5a9340d..42b7e0dd12fbece9785853e64f490edac4aa7f25 100644 |
| --- a/chrome/browser/resources/md_history/history_card_manager.js |
| +++ b/chrome/browser/resources/md_history/history_card_manager.js |
| @@ -26,8 +26,8 @@ Polymer({ |
| }, |
| menuIdentifier: { |
| - type: Number, |
| - value: 0 |
| + type: Object, |
| + value: function() { return {}; } |
| }, |
| searchTerm: { |
| @@ -58,6 +58,15 @@ Polymer({ |
| }, |
| /** |
| + * Search history based on the domain name associated with the pop-up menu. |
| + * @private |
| + */ |
| + onMoreFromSiteTap_: function() { |
| + this.fire('refresh-results', {search: this.menuIdentifier.domain}); |
| + this.closeMenu(); |
| + }, |
| + |
| + /** |
| * Clear the page completely so the page can display new results (search). |
| */ |
| resetHistoryResults: function() { |
| @@ -73,13 +82,15 @@ Polymer({ |
| */ |
| toggleMenu_: function(e) { |
| var menu = this.$['overflow-menu']; |
| + var itemId = e.detail.itemIdentifier; |
| // Menu closes if the same button is clicked. |
| - if (this.menuOpen && this.menuIdentifier == e.detail.accessTime) { |
| + if (this.menuOpen && (this.menuIdentifier.url == itemId.url) && |
| + (this.menuIdentifier.timestamps == itemId.timestamps)) { |
| this.closeMenu(); |
| } else { |
| this.menuOpen = true; |
| - this.menuIdentifier = e.detail.accessTime; |
| + this.menuIdentifier = itemId; |
| cr.ui.positionPopupAtPoint(e.detail.x + this.X_OFFSET_, e.detail.y, menu, |
| cr.ui.AnchorType.BEFORE); |
| @@ -88,6 +99,11 @@ Polymer({ |
| } |
| }, |
| + menuEquals_: function(menu, item) { |
| + console.log((menu.url == item.url) && (menu.timestamps == item.timestamps)); |
|
tsergeant
2016/02/12 00:48:55
Remove this log
|
| + return ((menu.url == item.url) && (menu.timestamps == item.timestamps)); |
|
tsergeant
2016/02/12 00:48:55
You can get rid of the outer parens
|
| + }, |
| + |
| /** |
| * Reformat the search results so they all have the same dateRelativeDay (will |
| * all display on the same card). Also so the date displays instead of time. |