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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 10079002: [File Manager] Hide hover state when using keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 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/resources/file_manager/css/file_manager.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index e33233d18d07d514f65ca03bfebd0dde6e082d63..481ce465b10b1efff0c249132bd909320b51f8dd 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -677,9 +677,14 @@ FileManager.prototype = {
this.filenameInput_.addEventListener(
'focus', this.onFilenameInputFocus_.bind(this));
- var listContainer = this.dialogDom_.querySelector('.list-container');
- listContainer.addEventListener('keydown', this.onListKeyDown_.bind(this));
- listContainer.addEventListener('keypress', this.onListKeyPress_.bind(this));
+ this.listContainer_ = this.dialogDom_.querySelector('.list-container');
+ this.listContainer_.addEventListener(
+ 'keydown', this.onListKeyDown_.bind(this));
+ this.listContainer_.addEventListener(
+ 'keypress', this.onListKeyPress_.bind(this));
+ this.listContainer_.addEventListener(
+ 'mousemove', this.onListMouseMove_.bind(this));
+
this.okButton_.addEventListener('click', this.onOk_.bind(this));
this.cancelButton_.addEventListener('click', this.onCancel_.bind(this));
@@ -4279,6 +4284,19 @@ FileManager.prototype = {
handleCommand('delete');
break;
}
+
+ switch (event.keyIdentifier) {
+ case 'Home':
+ case 'End':
+ case 'Up':
+ case 'Down':
+ case 'Left':
+ case 'Right':
+ // When navigating with keyboard we hide the distracting mouse hover
+ // highlighting until the user moves the mouse again.
+ this.listContainer_.classList.add('nohover');
+ break;
+ }
};
/**
@@ -4303,6 +4321,14 @@ FileManager.prototype = {
};
/**
+ * Mousemove event handler for the div.list-container element.
+ */
+ FileManager.prototype.onListMouseMove_ = function(event) {
+ // The user grabbed the mouse, restore the hover highlighting.
+ this.listContainer_.classList.remove('nohover');
+ };
+
+ /**
* Performs a 'text search' - selects a first list entry with name
* starting with entered text (case-insensitive).
*/
« no previous file with comments | « chrome/browser/resources/file_manager/css/file_manager.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698