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

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

Issue 1252503008: Files.app: Focus the active file list when toggle-view button is clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « ui/file_manager/file_manager/foreground/js/main_window_component.js ('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/ui/list_container.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/list_container.js b/ui/file_manager/file_manager/foreground/js/ui/list_container.js
index ff89af7f93e6ac9ee3d33a486d4bbb18ad67a511..3517dd9fb807f142e10ac608040311aca00d6b91 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/list_container.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/list_container.js
@@ -265,6 +265,23 @@ ListContainer.prototype.findListItemForNode = function(node) {
};
/**
+ * Focuses the active file list in the list container.
+ */
+ListContainer.prototype.focus = function() {
+ switch (this.currentListType) {
+ case ListContainer.ListType.DETAIL:
+ this.table.list.focus();
+ break;
+ case ListContainer.ListType.THUMBNAIL:
+ this.grid.focus();
+ break;
+ default:
+ assertNotReached();
+ break;
+ }
+};
+
+/**
* KeyDown event handler for the div#list-container element.
* @param {!Event} event Key event.
* @private
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/main_window_component.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698