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 /** | 5 /** |
6 * FileManager constructor. | 6 * FileManager constructor. |
7 * | 7 * |
8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
602 this.previewPanel_ = this.dialogDom_.querySelector('.preview-panel'); | 602 this.previewPanel_ = this.dialogDom_.querySelector('.preview-panel'); |
603 this.previewSummary_ = this.dialogDom_.querySelector('.preview-summary'); | 603 this.previewSummary_ = this.dialogDom_.querySelector('.preview-summary'); |
604 this.filenameInput_ = this.dialogDom_.querySelector( | 604 this.filenameInput_ = this.dialogDom_.querySelector( |
605 '#filename-input-box input'); | 605 '#filename-input-box input'); |
606 this.taskItems_ = this.dialogDom_.querySelector('#tasks'); | 606 this.taskItems_ = this.dialogDom_.querySelector('#tasks'); |
607 this.okButton_ = this.dialogDom_.querySelector('.ok'); | 607 this.okButton_ = this.dialogDom_.querySelector('.ok'); |
608 this.cancelButton_ = this.dialogDom_.querySelector('.cancel'); | 608 this.cancelButton_ = this.dialogDom_.querySelector('.cancel'); |
609 this.deleteButton_ = this.dialogDom_.querySelector('#delete-button'); | 609 this.deleteButton_ = this.dialogDom_.querySelector('#delete-button'); |
610 this.table_ = this.dialogDom_.querySelector('.detail-table'); | 610 this.table_ = this.dialogDom_.querySelector('.detail-table'); |
611 this.grid_ = this.dialogDom_.querySelector('.thumbnail-grid'); | 611 this.grid_ = this.dialogDom_.querySelector('.thumbnail-grid'); |
612 this.spinner_ = this.dialogDom_.querySelector('.spinner'); | 612 this.spinner_ = this.dialogDom_.querySelector('#spinner-without-text'); |
613 this.textSpinner_ = this.dialogDom_.querySelector('#spinner-with-text'); | |
613 this.showSpinner_(false); | 614 this.showSpinner_(false); |
614 this.butter_ = this.dialogDom_.querySelector('.butter-bar'); | 615 this.butter_ = this.dialogDom_.querySelector('.butter-bar'); |
615 this.unmountedPanel_ = this.dialogDom_.querySelector('#unmounted-panel'); | 616 this.unmountedPanel_ = this.dialogDom_.querySelector('#unmounted-panel'); |
616 | 617 |
617 this.breadcrumbs_ = new BreadcrumbsController( | 618 this.breadcrumbs_ = new BreadcrumbsController( |
618 this.dialogDom_.querySelector('#dir-breadcrumbs')); | 619 this.dialogDom_.querySelector('#dir-breadcrumbs')); |
619 this.breadcrumbs_.addEventListener( | 620 this.breadcrumbs_.addEventListener( |
620 'pathclick', this.onBreadcrumbClick_.bind(this)); | 621 'pathclick', this.onBreadcrumbClick_.bind(this)); |
621 this.searchBreadcrumbs_ = new BreadcrumbsController( | 622 this.searchBreadcrumbs_ = new BreadcrumbsController( |
622 this.dialogDom_.querySelector('#search-breadcrumbs')); | 623 this.dialogDom_.querySelector('#search-breadcrumbs')); |
(...skipping 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3307 }; | 3308 }; |
3308 | 3309 |
3309 FileManager.prototype.showSpinnerLater_ = function() { | 3310 FileManager.prototype.showSpinnerLater_ = function() { |
3310 this.cancelSpinnerTimeout_(); | 3311 this.cancelSpinnerTimeout_(); |
3311 this.showSpinnerTimeout_ = | 3312 this.showSpinnerTimeout_ = |
3312 setTimeout(this.showSpinner_.bind(this, true), 500); | 3313 setTimeout(this.showSpinner_.bind(this, true), 500); |
3313 }; | 3314 }; |
3314 | 3315 |
3315 FileManager.prototype.showSpinner_ = function(on) { | 3316 FileManager.prototype.showSpinner_ = function(on) { |
3316 this.cancelSpinnerTimeout_(); | 3317 this.cancelSpinnerTimeout_(); |
3317 this.spinner_.style.display = on ? '' : 'none'; | 3318 |
3319 if (on) { | |
3320 if (this.directoryModel_.isSearching()) { | |
Vladislav Kaznacheev
2012/07/30 11:19:46
I suggest keeping a single DOM element for both us
Oleg Eterevsky
2012/07/30 12:21:10
Done.
Oleg Eterevsky
2012/07/30 12:22:09
Done.
| |
3321 this.spinner_.style.display = 'none'; | |
3322 this.textSpinner_.textContent = str('SEARCH_SPINNER'); | |
3323 this.textSpinner_.style.display = 'block'; | |
3324 } else { | |
3325 this.spinner_.style.display = 'block'; | |
3326 this.textSpinner_.style.display = 'none'; | |
3327 } | |
3328 } else { | |
3329 this.spinner_.style.display = 'none'; | |
3330 this.textSpinner_.style.display = 'none'; | |
3331 } | |
3318 }; | 3332 }; |
3319 | 3333 |
3320 FileManager.prototype.onNewFolderCommand_ = function(event) { | 3334 FileManager.prototype.onNewFolderCommand_ = function(event) { |
3321 var defaultName = str('DEFAULT_NEW_FOLDER_NAME'); | 3335 var defaultName = str('DEFAULT_NEW_FOLDER_NAME'); |
3322 | 3336 |
3323 // Find a name that doesn't exist in the data model. | 3337 // Find a name that doesn't exist in the data model. |
3324 var files = this.directoryModel_.getFileList(); | 3338 var files = this.directoryModel_.getFileList(); |
3325 var hash = {}; | 3339 var hash = {}; |
3326 for (var i = 0; i < files.length; i++) { | 3340 for (var i = 0; i < files.length; i++) { |
3327 var name = files.item(i).name; | 3341 var name = files.item(i).name; |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4221 } | 4235 } |
4222 | 4236 |
4223 var defaultActionSeparator = | 4237 var defaultActionSeparator = |
4224 this.dialogDom_.querySelector('#default-action-separator'); | 4238 this.dialogDom_.querySelector('#default-action-separator'); |
4225 | 4239 |
4226 this.defaultActionMenuItem_.hidden = !taskItem; | 4240 this.defaultActionMenuItem_.hidden = !taskItem; |
4227 defaultActionSeparator.hidden = !taskItem; | 4241 defaultActionSeparator.hidden = !taskItem; |
4228 } | 4242 } |
4229 })(); | 4243 })(); |
4230 | 4244 |
OLD | NEW |