Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 08:03
Show Gist options
  • Save dbismut/87054782fc29d3661db7266387241cd3 to your computer and use it in GitHub Desktop.
Save dbismut/87054782fc29d3661db7266387241cd3 to your computer and use it in GitHub Desktop.
Part 2 - Setting this.from and this.to for the exiting transition
onExit = () => {
// we don't want the code to run if there is no
// preview element to transition to.
if (!this.preview) return;
this.from = {
top: 0,
height: this.post.offsetHeight,
width: this.post.offsetWidth,
borderRadius: this.postStyler.get('borderRadius')
};
this.to = this.getPreviewStyleAndPosition();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment