[turbolizer] Add two keyboard shortcuts: R for relayout, / for search.

/ also selects the search box.

BUG=

Review-Url: https://codereview.chromium.org/2169053002
Cr-Commit-Position: refs/heads/master@{#38027}
This commit is contained in:
bgeron 2016-07-25 08:24:43 -07:00 committed by Commit bot
parent 917f0093fb
commit 54d483d9f9

View File

@ -610,6 +610,19 @@ class GraphView extends View {
showSelectionFrontierNodes(d3.event.keyCode == 38, undefined, true);
break;
}
case 82:
// 'r'
if (!d3.event.ctrlKey) {
this.layoutAction(this);
} else {
eventHandled = false;
}
break;
case 191:
// '/'
document.getElementById("search-input").focus();
document.getElementById("search-input").select();
break;
default:
eventHandled = false;
break;