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 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 | 3231 |
3232 FileManager.prototype.showSpinnerLater_ = function() { | 3232 FileManager.prototype.showSpinnerLater_ = function() { |
3233 this.cancelSpinnerTimeout_(); | 3233 this.cancelSpinnerTimeout_(); |
3234 this.showSpinnerTimeout_ = | 3234 this.showSpinnerTimeout_ = |
3235 setTimeout(this.showSpinner_.bind(this, true), 500); | 3235 setTimeout(this.showSpinner_.bind(this, true), 500); |
3236 }; | 3236 }; |
3237 | 3237 |
3238 FileManager.prototype.showSpinner_ = function(on) { | 3238 FileManager.prototype.showSpinner_ = function(on) { |
3239 this.cancelSpinnerTimeout_(); | 3239 this.cancelSpinnerTimeout_(); |
3240 if (on) { | 3240 if (on) { |
3241 this.spinner_.textContent = | 3241 if (this.directoryModel_.isSearching()) { |
3242 this.directoryModel_.isSearching() ? str('SEARCH_SPINNER') : ''; | 3242 this.dialogContainer_.classList.add('searching'); |
3243 this.spinner_.style.display = ''; | 3243 } else { |
| 3244 this.spinner_.style.display = ''; |
| 3245 } |
3244 } else { | 3246 } else { |
3245 this.spinner_.style.display = 'none'; | 3247 this.spinner_.style.display = 'none'; |
| 3248 if (this.dialogContainer_) |
| 3249 this.dialogContainer_.classList.remove('searching'); |
3246 } | 3250 } |
3247 }; | 3251 }; |
3248 | 3252 |
3249 FileManager.prototype.onNewFolderCommand_ = function(event) { | 3253 FileManager.prototype.onNewFolderCommand_ = function(event) { |
3250 var defaultName = str('DEFAULT_NEW_FOLDER_NAME'); | 3254 var defaultName = str('DEFAULT_NEW_FOLDER_NAME'); |
3251 | 3255 |
3252 // Find a name that doesn't exist in the data model. | 3256 // Find a name that doesn't exist in the data model. |
3253 var files = this.directoryModel_.getFileList(); | 3257 var files = this.directoryModel_.getFileList(); |
3254 var hash = {}; | 3258 var hash = {}; |
3255 for (var i = 0; i < files.length; i++) { | 3259 for (var i = 0; i < files.length; i++) { |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4176 } | 4180 } |
4177 | 4181 |
4178 var defaultActionSeparator = | 4182 var defaultActionSeparator = |
4179 this.dialogDom_.querySelector('#default-action-separator'); | 4183 this.dialogDom_.querySelector('#default-action-separator'); |
4180 | 4184 |
4181 this.defaultActionMenuItem_.hidden = !taskItem; | 4185 this.defaultActionMenuItem_.hidden = !taskItem; |
4182 defaultActionSeparator.hidden = !taskItem; | 4186 defaultActionSeparator.hidden = !taskItem; |
4183 } | 4187 } |
4184 })(); | 4188 })(); |
4185 | 4189 |
OLD | NEW |