hotkeys: Handle up/down arrows in settings page.

The up/down arrows now navigate the left pane of the settings menu.
The code here was originally implemented as part of our settings
redesign, but the code was added in a place that became unreachable
after we fixed a bug with home_tab_obscured().  This commit
resurrects the code and places the guts of it in settings.js.  It
is possible that we want to clean this code up eventually to deal
better with hidden blocks.
This commit is contained in:
Steve Howell
2017-04-04 10:59:04 -07:00
committed by Tim Abbott
parent 4bbd73a9a2
commit 2ef9957cbc
3 changed files with 34 additions and 22 deletions

View File

@@ -1040,6 +1040,22 @@ exports.launch_page = function (tab) {
$active_tab.click();
};
exports.handle_up_arrow = function (e) {
var prev = e.target.previousElementSibling;
if ($(prev).css("display") !== "none") {
$(prev).focus().click();
}
};
exports.handle_down_arrow = function (e) {
var next = e.target.nextElementSibling;
if ($(next).css("display") !== "none") {
$(next).focus().click();
}
};
return exports;
}());