Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js

Issue 898853002: Files.app: Move 'any file type' item to the end of filter list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js b/ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js
index 36a95dc5866d9c8e34ef0f8fbdb3a23ad512639e..34515b2a68c1a1e3c14eac64b034108f06b85594 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/dialog_footer.js
@@ -71,7 +71,9 @@ function DialogFooter(dialogType, container, filenameInput) {
DialogFooter.prototype = {
/**
- * @return {number} Selected filter index.
+ * @return {number} Selected filter index. The index is 1 based and 0 means
+ * 'any file types'. Keep the meaniing consistent with the index passed to
+ * chrome.fileManagerPrivate.selectFile.
*/
get selectedFilterIndex() {
return ~~this.fileTypeSelector.value;
@@ -129,13 +131,6 @@ DialogFooter.getOKButtonLabel_ = function(dialogType) {
*/
DialogFooter.prototype.initFileTypeFilter = function(
fileTypes, includeAllFiles) {
- if (includeAllFiles) {
- var option = document.createElement('option');
- option.innerText = str('ALL_FILES_FILTER');
- option.value = 0;
- this.fileTypeSelector.appendChild(option);
- }
-
for (var i = 0; i < fileTypes.length; i++) {
var fileType = fileTypes[i];
var option = document.createElement('option');
@@ -171,6 +166,13 @@ DialogFooter.prototype.initFileTypeFilter = function(
this.fileTypeSelector.appendChild(option);
}
+ if (includeAllFiles) {
+ var option = document.createElement('option');
+ option.innerText = str('ALL_FILES_FILTER');
+ option.value = 0;
+ this.fileTypeSelector.appendChild(option);
+ }
+
var options = this.fileTypeSelector.querySelectorAll('option');
if (options.length >= 2) {
// There is in fact no choice, show the selector.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698