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..49a9b6c3d21428fd3bb4d6914a119639b73a800d 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 (util.getKeyModifiers(event) + event.keyIdentifier) { |
+ case 'Home': |
+ case 'End': |
+ case 'Up': |
dgozman
2012/04/13 12:16:24
What about Ctrl and Shift when user selects files?
Vladislav Kaznacheev
2012/04/13 12:43:50
Done.
|
+ 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). |
*/ |