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

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

Issue 1890783002: Use singular when only one item is selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc ('k') | 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/toolbar_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/toolbar_controller.js b/ui/file_manager/file_manager/foreground/js/toolbar_controller.js
index f25f7cfdda764798649a151e59504ed8bb185600..b3e61f03f6da2b1fc05509194b0460e19e057579 100644
--- a/ui/file_manager/file_manager/foreground/js/toolbar_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/toolbar_controller.js
@@ -125,18 +125,23 @@ ToolbarController.prototype.onSelectionChanged_ = function() {
var selection = this.selectionHandler_.selection;
// Update the label "x files selected." on the header.
+ var text;
if (selection.totalCount === 0) {
- this.filesSelectedLabel_.textContent = '';
+ text = '';
+ } else if (selection.totalCount === 1) {
+ if (selection.directoryCount == 0)
+ text = str('ONE_FILE_SELECTED');
+ else if (selection.fileCount == 0)
+ text = str('ONE_DIRECTORY_SELECTED');
} else {
- var text;
if (selection.directoryCount == 0)
text = strf('MANY_FILES_SELECTED', selection.fileCount);
else if (selection.fileCount == 0)
text = strf('MANY_DIRECTORIES_SELECTED', selection.directoryCount);
else
text = strf('MANY_ENTRIES_SELECTED', selection.totalCount);
- this.filesSelectedLabel_.textContent = text;
}
+ this.filesSelectedLabel_.textContent = text;
// Update visibility of the delete button.
this.deleteButton_.hidden =
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698