| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 */ | 64 */ |
| 65 onContextMenu_: function(e) { | 65 onContextMenu_: function(e) { |
| 66 e.preventDefault(); | 66 e.preventDefault(); |
| 67 if (!this.isSelectedItem_) { | 67 if (!this.isSelectedItem_) { |
| 68 this.dispatch(bookmarks.actions.selectItem( | 68 this.dispatch(bookmarks.actions.selectItem( |
| 69 this.itemId, false, false, this.getState())); | 69 this.itemId, false, false, this.getState())); |
| 70 } | 70 } |
| 71 this.fire('open-item-menu', { | 71 this.fire('open-item-menu', { |
| 72 x: e.clientX, | 72 x: e.clientX, |
| 73 y: e.clientY, | 73 y: e.clientY, |
| 74 item: this.item_, | |
| 75 }); | 74 }); |
| 76 }, | 75 }, |
| 77 | 76 |
| 78 /** | 77 /** |
| 79 * @param {Event} e | 78 * @param {Event} e |
| 80 * @private | 79 * @private |
| 81 */ | 80 */ |
| 82 onMenuButtonClick_: function(e) { | 81 onMenuButtonClick_: function(e) { |
| 83 e.stopPropagation(); | 82 e.stopPropagation(); |
| 84 this.dispatch(bookmarks.actions.selectItem( | 83 this.dispatch(bookmarks.actions.selectItem( |
| 85 this.itemId, false, false, this.getState())); | 84 this.itemId, false, false, this.getState())); |
| 86 this.fire('open-item-menu', { | 85 this.fire('open-item-menu', { |
| 87 targetElement: e.target, | 86 targetElement: e.target, |
| 88 item: this.item_, | |
| 89 }); | 87 }); |
| 90 }, | 88 }, |
| 91 | 89 |
| 92 /** | 90 /** |
| 93 * @param {Event} e | 91 * @param {Event} e |
| 94 * @private | 92 * @private |
| 95 */ | 93 */ |
| 96 onMenuButtonDblClick_: function(e) { | 94 onMenuButtonDblClick_: function(e) { |
| 97 e.stopPropagation(); | 95 e.stopPropagation(); |
| 98 }, | 96 }, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 }, | 132 }, |
| 135 | 133 |
| 136 /** | 134 /** |
| 137 * @param {string} url | 135 * @param {string} url |
| 138 * @private | 136 * @private |
| 139 */ | 137 */ |
| 140 updateFavicon_: function(url) { | 138 updateFavicon_: function(url) { |
| 141 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | 139 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); |
| 142 }, | 140 }, |
| 143 }); | 141 }); |
| OLD | NEW |