OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Namespace for utility functions. | 8 * Namespace for utility functions. |
9 */ | 9 */ |
10 var filelist = {}; | 10 var filelist = {}; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 value: false | 141 value: false |
142 } | 142 } |
143 }); | 143 }); |
144 | 144 |
145 tableColumnModelClass.call(columnModel, columns); | 145 tableColumnModelClass.call(columnModel, columns); |
146 self.columnModel = columnModel; | 146 self.columnModel = columnModel; |
147 self.setDateTimeFormat(true); | 147 self.setDateTimeFormat(true); |
148 self.setRenderFunction(self.renderTableRow_.bind(self, | 148 self.setRenderFunction(self.renderTableRow_.bind(self, |
149 self.getRenderFunction())); | 149 self.getRenderFunction())); |
150 | 150 |
151 if (util.platform.newUI()) | 151 if (util.platform.newUI()) { |
152 ScrollBar.createVertical(self, self.list); | 152 ScrollBar.createVertical(self, self.list); |
| 153 // Keep focus on the file list when clicking on the header. |
| 154 self.header.addEventListener('mousedown', function(e) { |
| 155 self.list.focus(); |
| 156 e.preventDefault(); |
| 157 }); |
| 158 } |
153 | 159 |
154 var handleSelectionChange = function() { | 160 var handleSelectionChange = function() { |
155 var selectAll = self.querySelector('#select-all-checkbox'); | 161 var selectAll = self.querySelector('#select-all-checkbox'); |
156 if (selectAll) | 162 if (selectAll) |
157 self.updateSelectAllCheckboxState_(selectAll); | 163 self.updateSelectAllCheckboxState_(selectAll); |
158 }; | 164 }; |
159 | 165 |
160 Object.defineProperty(self.list_, 'selectionModel', { | 166 Object.defineProperty(self.list_, 'selectionModel', { |
161 get: function() { | 167 get: function() { |
162 return this.selectionModel_; | 168 return this.selectionModel_; |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 break; | 814 break; |
809 } | 815 } |
810 } | 816 } |
811 if (url) { | 817 if (url) { |
812 iconDiv.style.backgroundImage = 'url(' + url + ')'; | 818 iconDiv.style.backgroundImage = 'url(' + url + ')'; |
813 } else { | 819 } else { |
814 iconDiv.style.backgroundImage = null; | 820 iconDiv.style.backgroundImage = null; |
815 } | 821 } |
816 } | 822 } |
817 }; | 823 }; |
OLD | NEW |