Commit 32c21e27 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[turbolizer] Make graph view's toolbar buttons focus the svg

... after executing their action.

This allows to search for a regex, click "hide unselected nodes", and
then immediately using graph view's keyboard shortcuts (e.g i, o, r).

Bug: v8:7327
Change-Id: Ieb7dbb3f1e32a78131500f8fb8b7805417c60e4e
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1930906Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65166}
parent 4105cce5
......@@ -384,6 +384,7 @@ export class GraphView extends PhaseView {
graph.layoutGraph();
graph.updateGraphVisibility();
graph.viewWholeGraph();
graph.focusOnSvg();
}
showAllAction(view: GraphView) {
......@@ -395,6 +396,7 @@ export class GraphView extends PhaseView {
});
view.updateGraphVisibility();
view.viewWholeGraph();
view.focusOnSvg();
}
showControlAction(view: GraphView) {
......@@ -406,6 +408,7 @@ export class GraphView extends PhaseView {
});
view.updateGraphVisibility();
view.viewWholeGraph();
view.focusOnSvg();
}
toggleHideDead(view: GraphView) {
......@@ -417,6 +420,7 @@ export class GraphView extends PhaseView {
}
const element = document.getElementById('toggle-hide-dead');
element.classList.toggle('button-input-toggled', view.state.hideDead);
view.focusOnSvg();
}
hideDead() {
......@@ -445,6 +449,7 @@ export class GraphView extends PhaseView {
}
}
view.updateGraphVisibility();
view.focusOnSvg();
}
hideSelectedAction(view: GraphView) {
......@@ -454,14 +459,17 @@ export class GraphView extends PhaseView {
}
}
view.selectionHandler.clear();
view.focusOnSvg();
}
zoomSelectionAction(view: GraphView) {
view.viewSelection();
view.focusOnSvg();
}
toggleTypesAction(view: GraphView) {
view.toggleTypes();
view.focusOnSvg();
}
searchInputAction(searchBar: HTMLInputElement, e: KeyboardEvent, onlyVisible: boolean) {
......@@ -492,11 +500,15 @@ export class GraphView extends PhaseView {
this.updateGraphVisibility();
searchBar.blur();
this.viewSelection();
(document.getElementById("graph").childNodes[0] as HTMLElement).focus();
this.focusOnSvg();
}
e.stopPropagation();
}
focusOnSvg() {
(document.getElementById("graph").childNodes[0] as HTMLElement).focus();
}
svgKeyDown() {
const view = this;
const state = this.state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment