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

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

Issue 251483002: Keep active directory when same root item on navigation list is activated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify comments. Created 6 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 | « 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/navigation_list.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/navigation_list.js b/ui/file_manager/file_manager/foreground/js/ui/navigation_list.js
index 75ae1d862dc5d70570f51519a06ef5659141576b..2092fdb5566370b9092ea39858bf29d60a299f7c 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/navigation_list.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/navigation_list.js
@@ -225,6 +225,8 @@ NavigationList.prototype.renderRoot_ = function(modelItem) {
if (!item.selected)
return;
this.activateModelItem_(item.modelItem);
+ // On clicking the root item, clears the selection.
+ this.directoryModel_.clearSelection();
}.bind(this);
item.addEventListener('click', handleClick);
@@ -278,9 +280,11 @@ NavigationList.prototype.selectByIndex = function(index) {
*/
NavigationList.prototype.activateModelItem_ = function(modelItem) {
var onEntryResolved = function(entry) {
- if (util.isSameEntry(this.directoryModel_.getCurrentDirEntry(), entry)) {
- // On clicking the current directory, clears the selection.
- this.directoryModel_.clearSelection();
+ // If the root item of active directory was same as newly activated
+ // root item, keep the active directory as it was.
+ var currentDir = this.directoryModel_.getCurrentDirEntry();
+ if (util.isSameEntry(entry, currentDir) ||
+ util.isDescendantEntry(entry, currentDir)) {
return;
}
« 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