aboutsummaryrefslogtreecommitdiff
path: root/src/components/timeline/timeline.js
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-03-06 12:03:42 -0500
committertaehoon <th.dev91@gmail.com>2019-03-06 12:10:29 -0500
commitaca3b37134ef797f9c112f9584bf42dee1d9c87e (patch)
treefeeab4db288825416b2887612d6b5a4daa985a45 /src/components/timeline/timeline.js
parent830f3762ef80ff794880a7033ab5c6c825bbaa54 (diff)
Use a cross browser safe solution to get scroll top
Diffstat (limited to 'src/components/timeline/timeline.js')
-rw-r--r--src/components/timeline/timeline.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 655bfb3f..c45f8947 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -132,7 +132,9 @@ const Timeline = {
}
if (count > 0) {
// only 'stream' them when you're scrolled to the top
- if (window.pageYOffset < 15 &&
+ const doc = document.documentElement
+ const top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)
+ if (top < 15 &&
!this.paused &&
!(this.unfocused && this.$store.state.config.pauseOnUnfocused)
) {