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

Side by Side Diff: chrome/browser/resources/md_bookmarks/item.js

Issue 2954273002: [MD Bookmarks] Restore focus after closing a dialog or context menu. (Closed)
Patch Set: fix deps Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'bookmarks-item', 6 is: 'bookmarks-item',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.MouseFocusBehavior, 9 bookmarks.MouseFocusBehavior,
10 bookmarks.StoreClient, 10 bookmarks.StoreClient,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 getDropTarget: function() { 60 getDropTarget: function() {
61 return this; 61 return this;
62 }, 62 },
63 63
64 /** 64 /**
65 * @param {Event} e 65 * @param {Event} e
66 * @private 66 * @private
67 */ 67 */
68 onContextMenu_: function(e) { 68 onContextMenu_: function(e) {
69 e.preventDefault(); 69 e.preventDefault();
70 this.focus();
70 if (!this.isSelectedItem_) 71 if (!this.isSelectedItem_)
71 this.selectThisItem_(); 72 this.selectThisItem_();
72 73
73 this.fire('open-item-menu', { 74 this.fire('open-item-menu', {
74 x: e.clientX, 75 x: e.clientX,
75 y: e.clientY, 76 y: e.clientY,
76 }); 77 });
77 }, 78 },
78 79
79 /** 80 /**
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 }, 150 },
150 151
151 /** 152 /**
152 * @param {string} url 153 * @param {string} url
153 * @private 154 * @private
154 */ 155 */
155 updateFavicon_: function(url) { 156 updateFavicon_: function(url) {
156 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); 157 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
157 }, 158 },
158 }); 159 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/edit_dialog.js ('k') | chrome/browser/resources/md_bookmarks/mouse_focus_behavior.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698