| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('cr.ui', function() { | 5 cr.define('cr.ui', function() { |
| 6 // require cr.ui.define | 6 // require cr.ui.define |
| 7 // require cr.ui.limitInputWidth | 7 // require cr.ui.limitInputWidth |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The number of pixels to indent per level. | 10 * The number of pixels to indent per level. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 */ | 50 */ |
| 51 decorate: function() { | 51 decorate: function() { |
| 52 // Make list focusable | 52 // Make list focusable |
| 53 if (!this.hasAttribute('tabindex')) | 53 if (!this.hasAttribute('tabindex')) |
| 54 this.tabIndex = 0; | 54 this.tabIndex = 0; |
| 55 | 55 |
| 56 this.addEventListener('click', this.handleClick); | 56 this.addEventListener('click', this.handleClick); |
| 57 this.addEventListener('mousedown', this.handleMouseDown); | 57 this.addEventListener('mousedown', this.handleMouseDown); |
| 58 this.addEventListener('dblclick', this.handleDblClick); | 58 this.addEventListener('dblclick', this.handleDblClick); |
| 59 this.addEventListener('keydown', this.handleKeyDown); | 59 this.addEventListener('keydown', this.handleKeyDown); |
| 60 |
| 61 this.setAttribute('role', 'group'); |
| 60 }, | 62 }, |
| 61 | 63 |
| 62 /** | 64 /** |
| 63 * Returns the tree item that are children of this tree. | 65 * Returns the tree item that are children of this tree. |
| 64 */ | 66 */ |
| 65 get items() { | 67 get items() { |
| 66 return this.children; | 68 return this.children; |
| 67 }, | 69 }, |
| 68 | 70 |
| 69 /** | 71 /** |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } | 690 } |
| 689 return item; | 691 return item; |
| 690 } | 692 } |
| 691 | 693 |
| 692 // Export | 694 // Export |
| 693 return { | 695 return { |
| 694 Tree: Tree, | 696 Tree: Tree, |
| 695 TreeItem: TreeItem | 697 TreeItem: TreeItem |
| 696 }; | 698 }; |
| 697 }); | 699 }); |
| OLD | NEW |