Chromium Code Reviews| 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 // require: listselectionmodel.js | 5 // require: listselectionmodel.js |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @fileoverview This implements a list control. | 8 * @fileoverview This implements a list control. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 var dataModel = this.dataModel; | 216 var dataModel = this.dataModel; |
| 217 if (dataModel) { | 217 if (dataModel) { |
| 218 return indexes.map(function(i) { | 218 return indexes.map(function(i) { |
| 219 return dataModel.item(i); | 219 return dataModel.item(i); |
| 220 }); | 220 }); |
| 221 } | 221 } |
| 222 return []; | 222 return []; |
| 223 }, | 223 }, |
| 224 | 224 |
| 225 /** | 225 /** |
| 226 * The HTML elements representing the items. This is just all the element | 226 * The HTML elements representing the items. This is just all the <li> |
|
arv (Not doing code reviews)
2010/12/15 02:47:27
I don't think <li> is correct here. Is there any o
Evan Stade
2010/12/15 04:12:38
good point
| |
| 227 * children but subclasses may override this to filter out certain elements. | 227 * children but subclasses may override this to filter out certain elements. |
| 228 * @type {HTMLCollection} | 228 * @type {HTMLCollection} |
| 229 */ | 229 */ |
| 230 get items() { | 230 get items() { |
|
arv (Not doing code reviews)
2010/12/15 02:47:27
Yeah, this cannot have been used before since it w
| |
| 231 return this.children; | 231 return this.querySelectorAll('li'); |
|
arv (Not doing code reviews)
2010/12/15 02:47:27
This also gives nested elements. I think we need t
| |
| 232 }, | 232 }, |
| 233 | 233 |
| 234 batchCount_: 0, | 234 batchCount_: 0, |
| 235 | 235 |
| 236 /** | 236 /** |
| 237 * When making a lot of updates to the list, the code could be wrapped in | 237 * When making a lot of updates to the list, the code could be wrapped in |
| 238 * the startBatchUpdates and finishBatchUpdates to increase performance. Be | 238 * the startBatchUpdates and finishBatchUpdates to increase performance. Be |
| 239 * sure that the code will not return without calling endBatchUpdates or the | 239 * sure that the code will not return without calling endBatchUpdates or the |
| 240 * list will not be correctly updated. | 240 * list will not be correctly updated. |
| 241 */ | 241 */ |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 } | 570 } |
| 571 } | 571 } |
| 572 }; | 572 }; |
| 573 | 573 |
| 574 cr.defineProperty(List, 'disabled', cr.PropertyKind.BOOL_ATTR); | 574 cr.defineProperty(List, 'disabled', cr.PropertyKind.BOOL_ATTR); |
| 575 | 575 |
| 576 return { | 576 return { |
| 577 List: List | 577 List: List |
| 578 } | 578 } |
| 579 }); | 579 }); |
| OLD | NEW |