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 /** @constructor */ | 5 /** @constructor */ |
6 function TaskManager() { } | 6 function TaskManager() { } |
7 | 7 |
8 cr.addSingletonGetter(TaskManager); | 8 cr.addSingletonGetter(TaskManager); |
9 | 9 |
10 TaskManager.prototype = { | 10 TaskManager.prototype = { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Initialize a context-menu, if the label exists and its context- | 199 // Initialize a context-menu, if the label exists and its context- |
200 // menu is not initialized yet. | 200 // menu is not initialized yet. |
201 if (label && !label.contextMenu) | 201 if (label && !label.contextMenu) |
202 cr.ui.contextMenuHandler.setContextMenu(label, | 202 cr.ui.contextMenuHandler.setContextMenu(label, |
203 this.tableContextMenu_); | 203 this.tableContextMenu_); |
204 } | 204 } |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 this.isFinishedInitDelayed_ = true; | 208 this.isFinishedInitDelayed_ = true; |
209 this.table_.redraw(); | 209 var t = this.table_; |
| 210 t.redraw(); |
| 211 addEventListener('resize', t.redraw.bind(t)); |
210 }, | 212 }, |
211 | 213 |
212 initColumnModel_: function() { | 214 initColumnModel_: function() { |
213 var table_columns = new Array(); | 215 var table_columns = new Array(); |
214 for (var i = 0; i < DEFAULT_COLUMNS.length; i++) { | 216 for (var i = 0; i < DEFAULT_COLUMNS.length; i++) { |
215 var column = DEFAULT_COLUMNS[i]; | 217 var column = DEFAULT_COLUMNS[i]; |
216 var columnId = column[0]; | 218 var columnId = column[0]; |
217 if (!isColumnEnabled(columnId)) | 219 if (!isColumnEnabled(columnId)) |
218 continue; | 220 continue; |
219 | 221 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 function init() { | 690 function init() { |
689 var params = parseQueryParams(window.location); | 691 var params = parseQueryParams(window.location); |
690 var opt = {}; | 692 var opt = {}; |
691 opt['isBackgroundMode'] = params.background; | 693 opt['isBackgroundMode'] = params.background; |
692 opt['isShowCloseButton'] = params.showclose; | 694 opt['isShowCloseButton'] = params.showclose; |
693 taskmanager.initialize(document.body, opt); | 695 taskmanager.initialize(document.body, opt); |
694 } | 696 } |
695 | 697 |
696 document.addEventListener('DOMContentLoaded', init); | 698 document.addEventListener('DOMContentLoaded', init); |
697 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); | 699 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); |
OLD | NEW |