Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2664)

Unified Diff: chrome/browser/resources/task_manager/main.js

Issue 8608007: cr/ui/list.js: Support rows with variable heights. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Omit the custom lead item height Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/table.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/task_manager/main.js
diff --git a/chrome/browser/resources/task_manager/main.js b/chrome/browser/resources/task_manager/main.js
index 5df154a73a69e6fd9983d8e05c88c2708c8fa2ab..a4827dee1d7367eab63b7c69f359b3b97c8641f4 100644
--- a/chrome/browser/resources/task_manager/main.js
+++ b/chrome/browser/resources/task_manager/main.js
@@ -319,7 +319,7 @@ TaskManager.prototype = {
this.table_.columnModel = this.columnModel_;
// Expands height of row when a process has some tasks.
- this.table_.autoExpands = true;
+ this.table_.fixedHeight = false;
this.table_.list.addEventListener('contextmenu',
this.onTableContextMenuOpened_.bind(this),
@@ -353,10 +353,11 @@ TaskManager.prototype = {
renderColumn_: function(entry, columnId, table) {
var container = this.document_.createElement('div');
- container.id = 'detail-container-' + columnId + '-pid' + entry.processId;
container.className = 'detail-container-' + columnId;
- if (entry[columnId]) {
+ if (entry && entry[columnId]) {
+ container.id = 'detail-container-' + columnId + '-pid' + entry.processId;
+
for (var i = 0; i < entry[columnId].length; i++) {
var label = document.createElement('div');
if (columnId == 'title') {
@@ -395,14 +396,20 @@ TaskManager.prototype = {
if (!dm || !sm)
return;
+ this.table_.list.startBatchUpdates();
// Splice takes the to-be-spliced-in array as individual parameters,
// rather than as an array, so we need to perform some acrobatics...
var args = [].slice.call(tasks);
- args.unshift(start, length);
+ args.unshift(start, dm.length);
+ sm.beginChange();
var oldSelectedIndexes = sm.selectedIndexes;
+
dm.splice.apply(dm, args);
+
sm.selectedIndexes = oldSelectedIndexes;
+ sm.endChange();
+ this.table_.list.endBatchUpdates();
},
onTaskAdd: function (start, length, tasks) {
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/table.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698