mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Bug 1577783 - Use inspectorFront's getNodeFrontFromNodeGrip function in WebConsole's openNodeInInspector. r=pbro,rcaliman.
We retrieve the right NodeFront from a given grip, which we can then tell the inspector panel to select. Differential Revision: https://phabricator.services.mozilla.com/D48810 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ca1e2e0939
commit
431636d12a
@ -437,17 +437,18 @@ class WebConsole {
|
||||
"inspector",
|
||||
"inspect_dom"
|
||||
);
|
||||
// TODO: Bug1574506 - Use the contextual WalkerFront for gripToNodeFront.
|
||||
const walkerFront = (await this.toolbox.target.getFront("inspector"))
|
||||
.walker;
|
||||
const onGripNodeToFront = walkerFront.gripToNodeFront(grip);
|
||||
const [front, inspector] = await Promise.all([
|
||||
onGripNodeToFront,
|
||||
|
||||
const onNodeFront = this.toolbox.target
|
||||
.getFront("inspector")
|
||||
.then(inspectorFront => inspectorFront.getNodeFrontFromNodeGrip(grip));
|
||||
|
||||
const [nodeFront, inspectorPanel] = await Promise.all([
|
||||
onNodeFront,
|
||||
onSelectInspector,
|
||||
]);
|
||||
|
||||
const onInspectorUpdated = inspector.once("inspector-updated");
|
||||
const onNodeFrontSet = this.toolbox.selection.setNodeFront(front, {
|
||||
const onInspectorUpdated = inspectorPanel.once("inspector-updated");
|
||||
const onNodeFrontSet = this.toolbox.selection.setNodeFront(nodeFront, {
|
||||
reason: "console",
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user