Chromium Code Reviews| Index: chrome/browser/resources/shared/js/cr/ui/list.js |
| diff --git a/chrome/browser/resources/shared/js/cr/ui/list.js b/chrome/browser/resources/shared/js/cr/ui/list.js |
| index 33a984ebf5e87e3565666798f8bf9ca90a2343d6..8f6b8d17e9fbe9bfacaea6b6e7a368b8156853a5 100644 |
| --- a/chrome/browser/resources/shared/js/cr/ui/list.js |
| +++ b/chrome/browser/resources/shared/js/cr/ui/list.js |
| @@ -223,12 +223,19 @@ cr.define('cr.ui', function() { |
| }, |
| /** |
| - * The HTML elements representing the items. This is just all the element |
| + * The HTML elements representing the items. This is just all the list item |
| * children but subclasses may override this to filter out certain elements. |
| * @type {HTMLCollection} |
| */ |
| get items() { |
| - return this.children; |
| + var listItems = []; |
| + var children = this.children; |
| + for (var i = 0; i < children.length; i++) { |
| + var classList = children[i].classList; |
| + if (classList && !classList.contains('spacer')) |
|
arv (Not doing code reviews)
2010/12/15 04:15:28
classList should never be falsey
|
| + listItems.push(children[i]); |
| + } |
| + return listItems; |
|
arv (Not doing code reviews)
2010/12/15 04:15:28
How about:
return Array.prototype.filter.call(thi
|
| }, |
| batchCount_: 0, |