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-folder-node', | 6 is: 'bookmarks-folder-node', |
7 | 7 |
8 behaviors: [ | 8 behaviors: [ |
9 bookmarks.StoreClient, | 9 bookmarks.StoreClient, |
10 ], | 10 ], |
(...skipping 26 matching lines...) Expand all Loading... |
37 computed: 'computeIsSelected_(itemId, selectedFolder_)' | 37 computed: 'computeIsSelected_(itemId, selectedFolder_)' |
38 }, | 38 }, |
39 }, | 39 }, |
40 | 40 |
41 /** @override */ | 41 /** @override */ |
42 attached: function() { | 42 attached: function() { |
43 this.watch('item_', function(state) { | 43 this.watch('item_', function(state) { |
44 return state.nodes[this.itemId]; | 44 return state.nodes[this.itemId]; |
45 }.bind(this)); | 45 }.bind(this)); |
46 this.watch('isClosed_', function(state) { | 46 this.watch('isClosed_', function(state) { |
47 return !!state.closedFolders[this.itemId]; | 47 return state.closedFolders.has(this.itemId); |
48 }.bind(this)); | 48 }.bind(this)); |
49 this.watch('selectedFolder_', function(state) { | 49 this.watch('selectedFolder_', function(state) { |
50 return state.selectedFolder; | 50 return state.selectedFolder; |
51 }); | 51 }); |
52 | 52 |
53 this.updateFromStore(); | 53 this.updateFromStore(); |
54 }, | 54 }, |
55 | 55 |
56 /** @return {HTMLElement} */ | 56 /** @return {HTMLElement} */ |
57 getDropTarget: function() { | 57 getDropTarget: function() { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 }, | 123 }, |
124 | 124 |
125 /** | 125 /** |
126 * @private | 126 * @private |
127 * @return {boolean} | 127 * @return {boolean} |
128 */ | 128 */ |
129 isRootFolder_: function() { | 129 isRootFolder_: function() { |
130 return this.depth == 0; | 130 return this.depth == 0; |
131 }, | 131 }, |
132 }); | 132 }); |
OLD | NEW |