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

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

Issue 11090015: Screen reader now reads the file manager selection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/table.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) 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 extends cr.ui.List for use in the table. 6 * @fileoverview This extends cr.ui.List for use in the table.
7 */ 7 */
8 8
9 cr.define('cr.ui.table', function() { 9 cr.define('cr.ui.table', function() {
10 /** @const */ var List = cr.ui.List; 10 /** @const */ var List = cr.ui.List;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 /** 64 /**
65 * Creates a new list item. 65 * Creates a new list item.
66 * @param {*} dataItem The value to use for the item. 66 * @param {*} dataItem The value to use for the item.
67 * @return {!ListItem} The newly created list item. 67 * @return {!ListItem} The newly created list item.
68 */ 68 */
69 createItem: function(dataItem) { 69 createItem: function(dataItem) {
70 return this.table_.getRenderFunction().call(null, dataItem, this.table_); 70 return this.table_.getRenderFunction().call(null, dataItem, this.table_);
71 }, 71 },
72 72
73 renderFunction_: function(dataItem, table) { 73 renderFunction_: function(dataItem, table) {
74 // `This` must not be accessed here, since it may be anything, especially
75 // not a pointer to this object.
76
74 var cm = table.columnModel; 77 var cm = table.columnModel;
75 var listItem = List.prototype.createItem.call(table.list, ''); 78 var listItem = List.prototype.createItem.call(table.list, '');
76
77 listItem.className = 'table-row'; 79 listItem.className = 'table-row';
78 80
79 for (var i = 0; i < cm.size; i++) { 81 for (var i = 0; i < cm.size; i++) {
80 var cell = table.ownerDocument.createElement('div'); 82 var cell = table.ownerDocument.createElement('div');
81 cell.style.width = cm.getWidth(i) + '%'; 83 cell.style.width = cm.getWidth(i) + '%';
82 cell.className = 'table-row-cell'; 84 cell.className = 'table-row-cell';
83 if (cm.isEndAlign(i)) 85 if (cm.isEndAlign(i))
84 cell.style.textAlign = 'end'; 86 cell.style.textAlign = 'end';
85 cell.appendChild( 87 cell.appendChild(
86 cm.getRenderFunction(i).call(null, dataItem, cm.getId(i), table)); 88 cm.getRenderFunction(i).call(null, dataItem, cm.getId(i), table));
87 89
88 listItem.appendChild(cell); 90 listItem.appendChild(cell);
89 } 91 }
90 92
91 return listItem; 93 return listItem;
92 }, 94 },
93 }; 95 };
94 96
95 /** 97 /**
96 * The table associated with the list. 98 * The table associated with the list.
97 * @type {cr.ui.Table} 99 * @type {cr.ui.Table}
98 */ 100 */
99 cr.defineProperty(TableList, 'table'); 101 cr.defineProperty(TableList, 'table');
100 102
101 return { 103 return {
102 TableList: TableList 104 TableList: TableList
103 }; 105 };
104 }); 106 });
OLDNEW
« 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