OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 Polymer({ | |
6 is: 'bookmarks-item', | |
7 | |
8 properties: { | |
9 /** @type {BookmarkTreeNode} */ | |
10 item: { | |
11 type: Object, | |
12 observer: 'onItemChanged_' | |
13 }, | |
14 | |
15 isFolder_: { | |
tsergeant
2017/01/03 23:31:17
Use the short form here:
isFolder_: Boolean
jiaxi
2017/01/04 02:50:16
Done.
| |
16 type: Boolean, | |
17 } | |
18 }, | |
19 | |
20 observers: [ | |
21 'updateFavicon_(item.url)' | |
22 ], | |
23 | |
24 /** | |
25 * @param {Event} e | |
26 * @private | |
27 */ | |
28 onMenuButtonOpenTap_: function(e) { | |
29 this.fire('toggle-menu', { | |
30 target: e.target | |
31 }); | |
32 }, | |
33 | |
34 /** @private */ | |
35 onItemChanged_: function() { | |
36 this.isFolder_ = !(this.item.url); | |
37 }, | |
38 | |
39 updateFavicon_: function(url) { | |
tsergeant
2017/01/03 23:31:17
@private
jiaxi
2017/01/04 02:50:16
Done.
| |
40 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | |
41 } | |
42 }); | |
OLD | NEW |