From 468a7629e7c13dd3585c33e467e79bbc07af5a13 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 7 Mar 2018 15:43:32 +0800 Subject: [PATCH] site: fix intersection-observer polyfill --- package.json | 1 + site/theme/template/Content/MainContent.jsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dfda7d18d1..238ad4b7db 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "fetch-jsonp": "^1.0.3", "glob": "^7.1.1", "immutability-helper": "^2.5.0", + "intersection-observer": "^0.5.0", "jest": "^22.4.2", "jsonml.js": "^0.1.0", "lint-staged": "^7.0.0", diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index 0b181520d8..7183b2a23e 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -85,8 +85,8 @@ export default class MainContent extends React.Component { if (this.scroller) { this.scroller.disable(); } - // eslint-disable-next-line - const scrollama = require('scrollama'); + require('intersection-observer'); // eslint-disable-line + const scrollama = require('scrollama'); // eslint-disable-line this.scroller = scrollama(); this.scroller .setup({