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