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

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

Issue 8585027: Moving checkboxes to a separate column. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fix 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
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/array_data_model.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 this.headerInner_.textContent = ''; 73 this.headerInner_.textContent = '';
74 74
75 if (!cm || ! dm) { 75 if (!cm || ! dm) {
76 return; 76 return;
77 } 77 }
78 78
79 for (var i = 0; i < cm.size; i++) { 79 for (var i = 0; i < cm.size; i++) {
80 var cell = this.ownerDocument.createElement('div'); 80 var cell = this.ownerDocument.createElement('div');
81 cell.style.width = cm.getWidth(i) + '%'; 81 cell.style.width = cm.getWidth(i) + '%';
82 cell.className = 'table-header-cell'; 82 cell.className = 'table-header-cell';
83 cell.addEventListener('click', this.createSortFunction_(i).bind(this)); 83 if (dm.isSortable(cm.getId(i)))
84 cell.addEventListener('click',
85 this.createSortFunction_(i).bind(this));
84 86
85 cell.appendChild(this.createHeaderLabel_(i)); 87 cell.appendChild(this.createHeaderLabel_(i));
86 this.headerInner_.appendChild(cell); 88 this.headerInner_.appendChild(cell);
87 } 89 }
88 this.appendSplitters_(); 90 this.appendSplitters_();
89 }, 91 },
90 92
91 /** 93 /**
92 * Appends column splitters to the table header. 94 * Appends column splitters to the table header.
93 */ 95 */
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 /** 160 /**
159 * The table associated with the header. 161 * The table associated with the header.
160 * @type {cr.ui.Table} 162 * @type {cr.ui.Table}
161 */ 163 */
162 cr.defineProperty(TableHeader, 'table'); 164 cr.defineProperty(TableHeader, 'table');
163 165
164 return { 166 return {
165 TableHeader: TableHeader 167 TableHeader: TableHeader
166 }; 168 };
167 }); 169 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/array_data_model.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698