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.MouseFocusBehavior, | 9 bookmarks.MouseFocusBehavior, |
10 bookmarks.StoreClient, | 10 bookmarks.StoreClient, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 */ | 71 */ |
72 onContextMenu_: function(e) { | 72 onContextMenu_: function(e) { |
73 e.preventDefault(); | 73 e.preventDefault(); |
74 this.focus(); | 74 this.focus(); |
75 if (!this.isSelectedItem_) | 75 if (!this.isSelectedItem_) |
76 this.selectThisItem_(); | 76 this.selectThisItem_(); |
77 | 77 |
78 this.fire('open-item-menu', { | 78 this.fire('open-item-menu', { |
79 x: e.clientX, | 79 x: e.clientX, |
80 y: e.clientY, | 80 y: e.clientY, |
| 81 source: MenuSource.LIST, |
81 }); | 82 }); |
82 }, | 83 }, |
83 | 84 |
84 /** | 85 /** |
85 * @param {Event} e | 86 * @param {Event} e |
86 * @private | 87 * @private |
87 */ | 88 */ |
88 onMenuButtonClick_: function(e) { | 89 onMenuButtonClick_: function(e) { |
89 e.stopPropagation(); | 90 e.stopPropagation(); |
90 e.preventDefault(); | 91 e.preventDefault(); |
91 this.selectThisItem_(); | 92 this.selectThisItem_(); |
92 this.fire('open-item-menu', { | 93 this.fire('open-item-menu', { |
93 targetElement: e.target, | 94 targetElement: e.target, |
| 95 source: MenuSource.LIST, |
94 }); | 96 }); |
95 }, | 97 }, |
96 | 98 |
97 /** | 99 /** |
98 * @param {Event} e | 100 * @param {Event} e |
99 * @private | 101 * @private |
100 */ | 102 */ |
101 onMenuButtonDblClick_: function(e) { | 103 onMenuButtonDblClick_: function(e) { |
102 e.stopPropagation(); | 104 e.stopPropagation(); |
103 }, | 105 }, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 }, | 160 }, |
159 | 161 |
160 /** | 162 /** |
161 * @param {string} url | 163 * @param {string} url |
162 * @private | 164 * @private |
163 */ | 165 */ |
164 updateFavicon_: function(url) { | 166 updateFavicon_: function(url) { |
165 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | 167 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); |
166 }, | 168 }, |
167 }); | 169 }); |
OLD | NEW |