OLD | NEW |
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 Loading... |
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 }); |
OLD | NEW |