| 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.MouseFocusBehavior, |
| 9 bookmarks.StoreClient, | 10 bookmarks.StoreClient, |
| 10 ], | 11 ], |
| 11 | 12 |
| 12 properties: { | 13 properties: { |
| 13 itemId: { | 14 itemId: { |
| 14 type: String, | 15 type: String, |
| 15 observer: 'updateFromStore', | 16 observer: 'updateFromStore', |
| 16 }, | 17 }, |
| 17 | 18 |
| 18 depth: { | 19 depth: { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 63 |
| 63 this.updateFromStore(); | 64 this.updateFromStore(); |
| 64 | 65 |
| 65 if (this.isSelectedFolder_) { | 66 if (this.isSelectedFolder_) { |
| 66 this.async(function() { | 67 this.async(function() { |
| 67 this.scrollIntoViewIfNeeded(); | 68 this.scrollIntoViewIfNeeded(); |
| 68 }); | 69 }); |
| 69 } | 70 } |
| 70 }, | 71 }, |
| 71 | 72 |
| 72 /** @return {HTMLElement} */ | 73 /** |
| 74 * Overriden from bookmarks.MouseFocusBehavior. |
| 75 * @return {!HTMLElement} |
| 76 */ |
| 73 getFocusTarget: function() { | 77 getFocusTarget: function() { |
| 74 return this.$.container; | 78 return this.$.container; |
| 75 }, | 79 }, |
| 76 | 80 |
| 77 /** @return {HTMLElement} */ | 81 /** @return {HTMLElement} */ |
| 78 getDropTarget: function() { | 82 getDropTarget: function() { |
| 79 return this.$.container; | 83 return this.$.container; |
| 80 }, | 84 }, |
| 81 | 85 |
| 82 /** @return {boolean} */ | 86 /** @return {boolean} */ |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 */ | 341 */ |
| 338 isRootFolder_: function() { | 342 isRootFolder_: function() { |
| 339 return this.itemId == ROOT_NODE_ID; | 343 return this.itemId == ROOT_NODE_ID; |
| 340 }, | 344 }, |
| 341 | 345 |
| 342 /** | 346 /** |
| 343 * @private | 347 * @private |
| 344 * @return {string} | 348 * @return {string} |
| 345 */ | 349 */ |
| 346 getTabIndex_: function() { | 350 getTabIndex_: function() { |
| 347 return this.isSelectedFolder_ ? '0' : ''; | 351 return this.isSelectedFolder_ ? '0' : '-1'; |
| 348 }, | 352 }, |
| 349 }); | 353 }); |
| OLD | NEW |