Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: chrome/browser/resources/md_history/history_item.js

Issue 2141433003: MD History: Shift focus to overflow menu icon while removing bookmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor change Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/md_history/history_item_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/md_history/history_item_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698