Last active
April 9, 2018 08:06
-
-
Save dbismut/c4c76e33ed6bc52a356368f00638c904 to your computer and use it in GitHub Desktop.
Part 2 - Adding scrollTop values to this.from and this.to
This file contains 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
onExit = () => { | |
// we don't want to run this 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'), | |
scrollTop: windowScroll.get('top') // add this | |
}; | |
// change this | |
this.to = { | |
...this.getPreviewStyleAndPosition(), | |
scrollTop: 0 | |
}; | |
const scrollTop = windowScroll.get('top'); | |
this.post.classList.add('scroll-block'); | |
this.postScroll.set('top', scrollTop); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment