Chromium Code Reviews| Index: chrome/browser/resources/apps_debugger/js/items_list.js |
| diff --git a/chrome/browser/resources/apps_debugger/js/items_list.js b/chrome/browser/resources/apps_debugger/js/items_list.js |
| index 08c35964af9af3a7fcf912cb2b0bf6c05a024c73..21aa4bbdce06ea977ea88e06adb6685f017b7f1f 100644 |
| --- a/chrome/browser/resources/apps_debugger/js/items_list.js |
| +++ b/chrome/browser/resources/apps_debugger/js/items_list.js |
| @@ -18,6 +18,9 @@ cr.define('apps_dev_tool', function() { |
| // The list of all apps. |
| var appList = []; |
| + // The list of all extensions. |
| + var extensionList = []; |
| + |
| /** const*/ var AppsDevTool = apps_dev_tool.AppsDevTool; |
| /** |
| @@ -56,14 +59,14 @@ cr.define('apps_dev_tool', function() { |
| * Refreshes the app. |
| */ |
| function reloadAppDisplay() { |
| - var itemsDiv = $('items'); |
| + ItemsList.prototype.data_ = extensionList; |
|
Dan Beam
2013/03/20 19:05:30
^ I'm confused as to what this is doing?
Gaurav
2013/03/29 21:14:26
It initializes the data in ItemsList fow which the
Dan Beam
2013/03/29 21:48:13
This should be setting this on an instance, not on
|
| - // Empty the current content. |
| - itemsDiv.textContent = ''; |
| + var extensions = $('extension-settings-list'); |
| + ItemsList.decorate(extensions); |
| ItemsList.prototype.data_ = appList; |
| - var itemsList = $('extension-settings-list'); |
| - ItemsList.decorate(itemsList); |
| + var apps = $('app-settings-list'); |
| + ItemsList.decorate(apps); |
| } |
| /** |
| @@ -71,18 +74,17 @@ cr.define('apps_dev_tool', function() { |
| * @param {string} filter Curent string in the search box. |
| */ |
| function rebuildAppList(filter) { |
| - if (!filter) { |
| - appList = completeList; |
| - return; |
| - } |
| - |
| appList = []; |
| + extensionList = []; |
| + |
| for (var i = 0; i < completeList.length; i++) { |
| var item = completeList[i]; |
| if (item.name.toLowerCase().search(filter) < 0) |
|
Dan Beam
2013/03/20 19:05:30
nit: if (filter && item.name.toLowerCase().search(
Gaurav
2013/03/29 21:14:26
Done.
|
| continue; |
| - |
| - appList.push(item); |
| + if (item.isApp) |
| + appList.push(item); |
| + else |
| + extensionList.push(item); |
| } |
| } |
| @@ -110,7 +112,7 @@ cr.define('apps_dev_tool', function() { |
| */ |
| showItemNodes_: function() { |
| // Iterate over the item data and add each item to the list. |
| - this.classList.toggle('empty-extension-list', this.data_.length == 0); |
| + this.classList.toggle('empty-item-list', this.data_.length == 0); |
| this.data_.forEach(this.createNode_, this); |
| }, |