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 28 matching lines...) Expand all Loading... |
39 'click': 'onClick_', | 39 'click': 'onClick_', |
40 'dblclick': 'onDblClick_', | 40 'dblclick': 'onDblClick_', |
41 }, | 41 }, |
42 | 42 |
43 /** @override */ | 43 /** @override */ |
44 attached: function() { | 44 attached: function() { |
45 this.watch('item_', function(store) { | 45 this.watch('item_', function(store) { |
46 return store.nodes[this.itemId]; | 46 return store.nodes[this.itemId]; |
47 }.bind(this)); | 47 }.bind(this)); |
48 this.watch('isSelectedItem_', function(store) { | 48 this.watch('isSelectedItem_', function(store) { |
49 return !!store.selection.items[this.itemId]; | 49 return !!store.selection.items.has(this.itemId); |
50 }.bind(this)); | 50 }.bind(this)); |
51 | 51 |
52 this.updateFromStore(); | 52 this.updateFromStore(); |
53 }, | 53 }, |
54 | 54 |
55 /** @return {BookmarksItemElement} */ | 55 /** @return {BookmarksItemElement} */ |
56 getDropTarget: function() { | 56 getDropTarget: function() { |
57 return this; | 57 return this; |
58 }, | 58 }, |
59 | 59 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 }, | 104 }, |
105 | 105 |
106 /** | 106 /** |
107 * @param {string} url | 107 * @param {string} url |
108 * @private | 108 * @private |
109 */ | 109 */ |
110 updateFavicon_: function(url) { | 110 updateFavicon_: function(url) { |
111 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | 111 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); |
112 }, | 112 }, |
113 }); | 113 }); |
OLD | NEW |