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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 this.filePopup_ = null; | 663 this.filePopup_ = null; |
664 | 664 |
665 this.dialogDom_.querySelector('#search-box').addEventListener( | 665 this.dialogDom_.querySelector('#search-box').addEventListener( |
666 'input', this.onSearchBoxUpdate_.bind(this)); | 666 'input', this.onSearchBoxUpdate_.bind(this)); |
667 | 667 |
668 this.defaultActionMenuItem_ = | 668 this.defaultActionMenuItem_ = |
669 this.dialogDom_.querySelector('#default-action'); | 669 this.dialogDom_.querySelector('#default-action'); |
670 this.defaultActionMenuItem_.addEventListener('activate', | 670 this.defaultActionMenuItem_.addEventListener('activate', |
671 this.dispatchSelectionAction_.bind(this)); | 671 this.dispatchSelectionAction_.bind(this)); |
672 | 672 |
| 673 this.dialogDom_.querySelector('#new-folder').addEventListener('click', |
| 674 this.onNewFolderCommand_.bind(this)); |
| 675 |
673 this.fileTypeSelector_ = this.dialogDom_.querySelector('#file-type'); | 676 this.fileTypeSelector_ = this.dialogDom_.querySelector('#file-type'); |
674 this.initFileTypeFilter_(); | 677 this.initFileTypeFilter_(); |
675 // Populate the static localized strings. | 678 // Populate the static localized strings. |
676 i18nTemplate.process(this.document_, loadTimeData); | 679 i18nTemplate.process(this.document_, loadTimeData); |
677 }; | 680 }; |
678 | 681 |
679 FileManager.prototype.onBreadcrumbClick_ = function(event) { | 682 FileManager.prototype.onBreadcrumbClick_ = function(event) { |
680 this.directoryModel_.changeDirectory(event.path); | 683 this.directoryModel_.changeDirectory(event.path); |
681 }; | 684 }; |
682 | 685 |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 null /* callback */, box); | 2052 null /* callback */, box); |
2050 } | 2053 } |
2051 } | 2054 } |
2052 }; | 2055 }; |
2053 | 2056 |
2054 /** | 2057 /** |
2055 * Restore the item which is being renamed while refreshing the file list. Do | 2058 * Restore the item which is being renamed while refreshing the file list. Do |
2056 * nothing if no item is being renamed or such an item disappeared. | 2059 * nothing if no item is being renamed or such an item disappeared. |
2057 * | 2060 * |
2058 * While refreshing file list it gets repopulated with new file entries. | 2061 * While refreshing file list it gets repopulated with new file entries. |
2059 * There is not a big difference wether DOM items stay the same or not. | 2062 * There is not a big difference whether DOM items stay the same or not. |
2060 * Except for the item that the user is renaming. | 2063 * Except for the item that the user is renaming. |
2061 */ | 2064 */ |
2062 FileManager.prototype.restoreItemBeingRenamed_ = function() { | 2065 FileManager.prototype.restoreItemBeingRenamed_ = function() { |
2063 if (!this.isRenamingInProgress()) | 2066 if (!this.isRenamingInProgress()) |
2064 return; | 2067 return; |
2065 | 2068 |
2066 var dm = this.directoryModel_; | 2069 var dm = this.directoryModel_; |
2067 var leadIndex = dm.getFileListSelection().leadIndex; | 2070 var leadIndex = dm.getFileListSelection().leadIndex; |
2068 if (leadIndex < 0) | 2071 if (leadIndex < 0) |
2069 return; | 2072 return; |
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4192 } | 4195 } |
4193 | 4196 |
4194 var defaultActionSeparator = | 4197 var defaultActionSeparator = |
4195 this.dialogDom_.querySelector('#default-action-separator'); | 4198 this.dialogDom_.querySelector('#default-action-separator'); |
4196 | 4199 |
4197 this.defaultActionMenuItem_.hidden = !taskItem; | 4200 this.defaultActionMenuItem_.hidden = !taskItem; |
4198 defaultActionSeparator.hidden = !taskItem; | 4201 defaultActionSeparator.hidden = !taskItem; |
4199 } | 4202 } |
4200 })(); | 4203 })(); |
4201 | 4204 |
OLD | NEW |