OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 getRectForContextMenu: function() { | 211 getRectForContextMenu: function() { |
212 // TODO(arv): Add trait support so we can share more code between trees | 212 // TODO(arv): Add trait support so we can share more code between trees |
213 // and lists. | 213 // and lists. |
214 if (this.selectedItem) | 214 if (this.selectedItem) |
215 return this.selectedItem.rowElement.getBoundingClientRect(); | 215 return this.selectedItem.rowElement.getBoundingClientRect(); |
216 return this.getBoundingClientRect(); | 216 return this.getBoundingClientRect(); |
217 } | 217 } |
218 }; | 218 }; |
219 | 219 |
220 /** | 220 /** |
221 * Determines the visibility of icons next to the treeItem labels. If defined, | |
222 * space is reserved next to treeItem labels for icons. If set to 'parent', | |
223 * folder icons will be displayed next to expandable parent nodes. If set to | |
224 * 'all' folder icons will be displayed next to all nodes. Icons can be set | |
225 * using the treeItem's icon property. | |
226 */ | |
227 cr.defineProperty(Tree, 'icon-visibility', cr.PropertyKind.ATTR); | |
arv (Not doing code reviews)
2011/10/28 16:15:12
Sorry, this will not work. The property name shoul
flackr
2011/10/28 22:32:50
Sorry, is there an appropriate place to define the
arv (Not doing code reviews)
2011/10/28 22:41:03
I think I actually removed support for default val
flackr
2011/10/31 14:37:56
No problem, I changed the styles to make anything
| |
228 | |
229 /** | |
221 * This is used as a blueprint for new tree item elements. | 230 * This is used as a blueprint for new tree item elements. |
222 * @type {!HTMLElement} | 231 * @type {!HTMLElement} |
223 */ | 232 */ |
224 var treeItemProto = (function() { | 233 var treeItemProto = (function() { |
225 var treeItem = cr.doc.createElement('div'); | 234 var treeItem = cr.doc.createElement('div'); |
226 treeItem.className = 'tree-item'; | 235 treeItem.className = 'tree-item'; |
227 treeItem.innerHTML = '<div class=tree-row>' + | 236 treeItem.innerHTML = '<div class=tree-row>' + |
228 '<span class=expand-icon></span>' + | 237 '<span class=expand-icon></span>' + |
229 '<span class=tree-label></span>' + | 238 '<span class=tree-label></span>' + |
230 '</div>' + | 239 '</div>' + |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 } | 665 } |
657 return item; | 666 return item; |
658 } | 667 } |
659 | 668 |
660 // Export | 669 // Export |
661 return { | 670 return { |
662 Tree: Tree, | 671 Tree: Tree, |
663 TreeItem: TreeItem | 672 TreeItem: TreeItem |
664 }; | 673 }; |
665 }); | 674 }); |
OLD | NEW |