Created
February 10, 2020 11:18
-
-
Save juliandescottes/440c7594a25644f49c26f2f314719759 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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