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

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

Issue 8548012: Added "select all/none" checkbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 is a table column model 6 * @fileoverview This is a table column model
7 */ 7 */
8 cr.define('cr.ui.table', function() { 8 cr.define('cr.ui.table', function() {
9 const EventTarget = cr.EventTarget; 9 const EventTarget = cr.EventTarget;
10 const Event = cr.Event; 10 const Event = cr.Event;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (index < 0 || index >= this.columns_.size - 1) 125 if (index < 0 || index >= this.columns_.size - 1)
126 return; 126 return;
127 if (renderFunction !== this.columns_[index].renderFunction) 127 if (renderFunction !== this.columns_[index].renderFunction)
128 return; 128 return;
129 129
130 this.columns_[index].renderFunction = renderFunction; 130 this.columns_[index].renderFunction = renderFunction;
131 cr.dispatchSimpleEvent(this, 'change'); 131 cr.dispatchSimpleEvent(this, 'change');
132 }, 132 },
133 133
134 /** 134 /**
135 * Render the column header.
136 * @param {number} index The index of the column.
137 * @param {cr.ui.Table} Owner table.
138 */
139 renderHeader: function(index, table) {
140 var c = this.columns_[index];
141 return c.headerRenderFunction.call(c, table);
142 },
143
144 /**
135 * The total width of the columns. 145 * The total width of the columns.
136 * @type {number} 146 * @type {number}
137 */ 147 */
138 get totalWidth() { 148 get totalWidth() {
139 return this.totalWidth_; 149 return this.totalWidth_;
140 }, 150 },
141 151
142 /** 152 /**
143 * Normalizes widths to make their sum 100%. 153 * Normalizes widths to make their sum 100%.
144 */ 154 */
(...skipping 18 matching lines...) Expand all
163 return i; 173 return i;
164 } 174 }
165 return -1; 175 return -1;
166 }, 176 },
167 }; 177 };
168 178
169 return { 179 return {
170 TableColumnModel: TableColumnModel 180 TableColumnModel: TableColumnModel
171 }; 181 };
172 }); 182 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698