Skip to content

Instantly share code, notes, and snippets.

@juliandescottes
Created February 10, 2020 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliandescottes/440c7594a25644f49c26f2f314719759 to your computer and use it in GitHub Desktop.
Save juliandescottes/440c7594a25644f49c26f2f314719759 to your computer and use it in GitHub Desktop.
async onAnimationsMutation(changes) {
if (!this.isPanelVisible()) {
return;
}
// ...
}
async onTargetAvailable({ isTopLevel, targetFront }) {
if (isTopLevel) {
this.animationsFront = await targetFront.getFront("animations");
this.animationsFront.setWalkerActor(this.inspector.walker);
this.animationsFront.on("mutations", this.onAnimationsMutation);
}
}
async initListeners() {
await this.inspector.toolbox.targetList.watchTargets(
[this.inspector.toolbox.targetList.TYPES.FRAME],
this.onTargetAvailable
);
this.inspector.sidebar.on("select", this.onSidebarSelectionChanged);
// ... attach all the listeners ...
this.inspector.toolbox.on("select", this.onSidebarSelectionChanged);
// Call onSidebarSelectionChanged because we might have missed the initial
// "select" events while waiting for the target
this.onSidebarSelectionChanged();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment