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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/table/table_header.js

Issue 9379023: Tweaks for improving file manager performance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finish plumbing callbacks through Created 8 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @fileoverview This implements a table header. 6 * @fileoverview This implements a table header.
7 */ 7 */
8 8
9 cr.define('cr.ui.table', function() { 9 cr.define('cr.ui.table', function() {
10 const TableSplitter = cr.ui.TableSplitter; 10 const TableSplitter = cr.ui.TableSplitter;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return; 55 return;
56 } 56 }
57 this.headerInner_.textContent = ''; 57 this.headerInner_.textContent = '';
58 for (var i = 0; i < cm.size; i++) { 58 for (var i = 0; i < cm.size; i++) {
59 headerCells[i].style.width = cm.getWidth(i) + '%'; 59 headerCells[i].style.width = cm.getWidth(i) + '%';
60 this.headerInner_.appendChild(headerCells[i]); 60 this.headerInner_.appendChild(headerCells[i]);
61 } 61 }
62 this.appendSplitters_(); 62 this.appendSplitters_();
63 }, 63 },
64 64
65 batchCount_: 0,
66
67 startBatchUpdates: function() {
68 this.batchCount_++;
69 },
70
71 endBatchUpdates: function() {
72 this.batchCount_--;
73 if (this.batchCount_ == 0)
74 this.redraw();
75 },
76
65 /** 77 /**
66 * Redraws table header. 78 * Redraws table header.
67 */ 79 */
68 redraw: function() { 80 redraw: function() {
81 if (this.batchCount_ != 0)
82 return;
83
69 var cm = this.table_.columnModel; 84 var cm = this.table_.columnModel;
70 var dm = this.table_.dataModel; 85 var dm = this.table_.dataModel;
71 86
72 this.updateWidth(); 87 this.updateWidth();
73 this.headerInner_.textContent = ''; 88 this.headerInner_.textContent = '';
74 89
75 if (!cm || ! dm) { 90 if (!cm || ! dm) {
76 return; 91 return;
77 } 92 }
78 93
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 /** 170 /**
156 * The table associated with the header. 171 * The table associated with the header.
157 * @type {cr.ui.Table} 172 * @type {cr.ui.Table}
158 */ 173 */
159 cr.defineProperty(TableHeader, 'table'); 174 cr.defineProperty(TableHeader, 'table');
160 175
161 return { 176 return {
162 TableHeader: TableHeader 177 TableHeader: TableHeader
163 }; 178 };
164 }); 179 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698