OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
7 /** | 7 /** |
8 * Creates a new list item element. | 8 * Creates a new list item element. |
9 * @param {string} opt_label The text label for the item. | 9 * @param {string} opt_label The text label for the item. |
10 * @constructor | 10 * @constructor |
(...skipping 12 matching lines...) Expand all Loading... | |
23 return this.textContent; | 23 return this.textContent; |
24 }, | 24 }, |
25 set label(label) { | 25 set label(label) { |
26 this.textContent = label; | 26 this.textContent = label; |
27 }, | 27 }, |
28 | 28 |
29 /** | 29 /** |
30 * Called when an element is decorated as a list item. | 30 * Called when an element is decorated as a list item. |
31 */ | 31 */ |
32 decorate: function() { | 32 decorate: function() { |
33 } | 33 }, |
34 | |
35 /** | |
36 * Called when the selection state of this element changes. | |
37 */ | |
38 selectionChanged: function() { | |
arv (Not doing code reviews)
2010/12/17 20:07:34
I think a better way is to change the current sele
James Hawkins
2010/12/17 21:32:40
Ok, I think I've made the change like you've sugge
| |
39 }, | |
34 }; | 40 }; |
35 | 41 |
36 /** | 42 /** |
37 * Whether the item is selected. Setting this does not update the underlying | 43 * Whether the item is selected. Setting this does not update the underlying |
38 * selection model. This is only used for display purpose. | 44 * selection model. This is only used for display purpose. |
39 * @type {boolean} | 45 * @type {boolean} |
40 */ | 46 */ |
41 cr.defineProperty(ListItem, 'selected', cr.PropertyKind.BOOL_ATTR); | 47 cr.defineProperty(ListItem, 'selected', cr.PropertyKind.BOOL_ATTR); |
42 | 48 |
43 /** | 49 /** |
44 * Whether the item is the lead in a selection. Setting this does not update | 50 * Whether the item is the lead in a selection. Setting this does not update |
45 * the underlying selection model. This is only used for display purpose. | 51 * the underlying selection model. This is only used for display purpose. |
46 * @type {boolean} | 52 * @type {boolean} |
47 */ | 53 */ |
48 cr.defineProperty(ListItem, 'lead', cr.PropertyKind.BOOL_ATTR); | 54 cr.defineProperty(ListItem, 'lead', cr.PropertyKind.BOOL_ATTR); |
49 | 55 |
50 return { | 56 return { |
51 ListItem: ListItem | 57 ListItem: ListItem |
52 }; | 58 }; |
53 }); | 59 }); |
OLD | NEW |