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

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

Issue 2777503002: [MD Bookmarks] Deselect items when clicking outside the bookmark card. (Closed)
Patch Set: rebase Created 3 years, 8 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.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 this.isFolder_ = !(this.item_.url); 82 this.isFolder_ = !(this.item_.url);
83 }, 83 },
84 84
85 /** 85 /**
86 * @param {Event} e 86 * @param {Event} e
87 * @private 87 * @private
88 */ 88 */
89 onClick_: function(e) { 89 onClick_: function(e) {
90 this.dispatch(bookmarks.actions.selectItem( 90 this.dispatch(bookmarks.actions.selectItem(
91 this.itemId, e.ctrlKey, e.shiftKey, this.getState())); 91 this.itemId, e.ctrlKey, e.shiftKey, this.getState()));
92 e.stopPropagation();
92 }, 93 },
93 94
94 /** 95 /**
95 * @param {Event} e 96 * @param {Event} e
96 * @private 97 * @private
97 */ 98 */
98 onDblClick_: function(e) { 99 onDblClick_: function(e) {
99 if (!this.item_.url) 100 if (!this.item_.url)
100 this.dispatch(bookmarks.actions.selectFolder(this.item_.id)); 101 this.dispatch(bookmarks.actions.selectFolder(this.item_.id));
101 else 102 else
102 chrome.tabs.create({url: this.item_.url}); 103 chrome.tabs.create({url: this.item_.url});
103 }, 104 },
104 105
105 /** 106 /**
106 * @param {string} url 107 * @param {string} url
107 * @private 108 * @private
108 */ 109 */
109 updateFavicon_: function(url) { 110 updateFavicon_: function(url) {
110 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); 111 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
111 }, 112 },
112 }); 113 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/actions.js ('k') | chrome/browser/resources/md_bookmarks/list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698