| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return state.closedFolders.has(this.itemId); | 54 return state.closedFolders.has(this.itemId); |
| 55 }.bind(this)); | 55 }.bind(this)); |
| 56 this.watch('selectedFolder_', function(state) { | 56 this.watch('selectedFolder_', function(state) { |
| 57 return state.selectedFolder; | 57 return state.selectedFolder; |
| 58 }); | 58 }); |
| 59 this.watch('searchActive_', function(state) { | 59 this.watch('searchActive_', function(state) { |
| 60 return bookmarks.util.isShowingSearch(state); | 60 return bookmarks.util.isShowingSearch(state); |
| 61 }); | 61 }); |
| 62 | 62 |
| 63 this.updateFromStore(); | 63 this.updateFromStore(); |
| 64 |
| 65 if (this.isSelectedFolder_) { |
| 66 this.async(function() { |
| 67 this.scrollIntoViewIfNeeded(); |
| 68 }); |
| 69 } |
| 64 }, | 70 }, |
| 65 | 71 |
| 66 /** @return {HTMLElement} */ | 72 /** @return {HTMLElement} */ |
| 67 getFocusTarget: function() { | 73 getFocusTarget: function() { |
| 68 return this.$.container; | 74 return this.$.container; |
| 69 }, | 75 }, |
| 70 | 76 |
| 71 /** @return {HTMLElement} */ | 77 /** @return {HTMLElement} */ |
| 72 getDropTarget: function() { | 78 getDropTarget: function() { |
| 73 return this.$.container; | 79 return this.$.container; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 }, | 298 }, |
| 293 | 299 |
| 294 /** | 300 /** |
| 295 * @private | 301 * @private |
| 296 * @return {string} | 302 * @return {string} |
| 297 */ | 303 */ |
| 298 getTabIndex_: function() { | 304 getTabIndex_: function() { |
| 299 return this.isSelectedFolder_ ? '0' : ''; | 305 return this.isSelectedFolder_ ? '0' : ''; |
| 300 }, | 306 }, |
| 301 }); | 307 }); |
| OLD | NEW |