| 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 properties: { | 8 properties: { |
| 9 /** @type {BookmarkTreeNode} */ | 9 /** @type {BookmarkTreeNode} */ |
| 10 item: { | 10 item: {type: Object, observer: 'onItemChanged_'}, |
| 11 type: Object, | |
| 12 observer: 'onItemChanged_' | |
| 13 }, | |
| 14 | 11 |
| 15 isFolder_: Boolean, | 12 isFolder_: Boolean, |
| 16 }, | 13 }, |
| 17 | 14 |
| 18 observers: [ | 15 observers: ['updateFavicon_(item.url)'], |
| 19 'updateFavicon_(item.url)' | |
| 20 ], | |
| 21 | 16 |
| 22 /** | 17 /** |
| 23 * @param {Event} e | 18 * @param {Event} e |
| 24 * @private | 19 * @private |
| 25 */ | 20 */ |
| 26 onMenuButtonOpenTap_: function(e) { | 21 onMenuButtonOpenTap_: function(e) { |
| 27 this.fire('toggle-menu', { | 22 this.fire('toggle-menu', {target: e.target}); |
| 28 target: e.target | |
| 29 }); | |
| 30 }, | 23 }, |
| 31 | 24 |
| 32 /** @private */ | 25 /** @private */ |
| 33 onItemChanged_: function() { | 26 onItemChanged_: function() { |
| 34 this.isFolder_ = !(this.item.url); | 27 this.isFolder_ = !(this.item.url); |
| 35 }, | 28 }, |
| 36 | 29 |
| 37 /** @private */ | 30 /** @private */ |
| 38 updateFavicon_: function(url) { | 31 updateFavicon_: function(url) { |
| 39 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | 32 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); |
| 40 } | 33 } |
| 41 }); | 34 }); |
| OLD | NEW |