Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/file_manager.js |
| diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js |
| index 2ceb222e10faf1f797dff30281edac1825196b45..d92e0fee703cbe5b69f2583283d73670b607fe99 100644 |
| --- a/chrome/browser/resources/file_manager/js/file_manager.js |
| +++ b/chrome/browser/resources/file_manager/js/file_manager.js |
| @@ -518,20 +518,18 @@ FileManager.prototype = { |
| // Always sharing the data model between the detail/thumb views confuses |
| // them. Instead we maintain this bogus data model, and hook it up to the |
| // view that is not in use. |
| - this.emptyDataModel_ = new cr.ui.table.TableDataModel([]); |
| + this.emptyDataModel_ = new cr.ui.ArrayDataModel([]); |
| - this.dataModel_ = new cr.ui.table.TableDataModel([]); |
| + this.dataModel_ = new cr.ui.ArrayDataModel([]); |
| this.dataModel_.sort('name'); |
| - this.dataModel_.addEventListener('sorted', |
| - this.onDataModelSorted_.bind(this)); |
| this.dataModel_.prepareSort = this.prepareSort_.bind(this); |
| if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE || |
| this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FOLDER || |
| this.dialogType_ == FileManager.DialogType.SELECT_SAVEAS_FILE) { |
| - this.selectionModelClass_ = cr.ui.table.TableSingleSelectionModel; |
| + this.selectionModelClass_ = cr.ui.ListSingleSelectionModel; |
| } else { |
| - this.selectionModelClass_ = cr.ui.table.TableSelectionModel; |
| + this.selectionModelClass_ = cr.ui.ListSelectionModel; |
| } |
| this.initTable_(); |
| @@ -728,7 +726,7 @@ FileManager.prototype = { |
| self.grid_.redraw(); |
|
rginda
2011/05/17 23:56:43
I think this will need to become invalidateAndRedr
vsevik
2011/05/18 11:32:17
This seems unrelated to this change which is compl
rginda
2011/05/18 23:45:19
Where did invalidateAndRedraw come from? I though
|
| }, 0); |
| } else { |
| - this.currentList_.redraw(); |
| + this.currentList_.invalidateAndRedraw(); |
| } |
| }; |
| @@ -1426,16 +1424,6 @@ FileManager.prototype = { |
| }; |
| /** |
| - * Invoked by the table dataModel after a sort completes. |
| - * |
| - * We use this hook to make sure selected files stay visible after a sort. |
| - */ |
| - FileManager.prototype.onDataModelSorted_ = function() { |
| - var i = this.currentList_.selectionModel.leadIndex; |
| - this.currentList_.scrollIntoView(i); |
| - } |
| - |
| - /** |
| * Update the selection summary UI when the selection summarization completes. |
| */ |
| FileManager.prototype.onSelectionSummarized_ = function() { |
| @@ -1568,9 +1556,6 @@ FileManager.prototype = { |
| function onReadSome(entries) { |
| if (entries.length == 0) { |
| - if (self.dataModel_.sortStatus.field != 'name') |
| - self.dataModel_.updateIndex(0); |
| - |
| if (opt_callback) |
| opt_callback(); |
| return; |
| @@ -1616,7 +1601,6 @@ FileManager.prototype = { |
| var spliceArgs = [].slice.call(this.rootEntries_); |
| spliceArgs.unshift(0, 0); // index, deleteCount |
| self.dataModel_.splice.apply(self.dataModel_, spliceArgs); |
| - self.dataModel_.updateIndex(0); |
| if (opt_callback) |
| opt_callback(); |