From f9273bc95a06e6229325dadb3a5d2174b66676ab Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 17 Aug 2017 11:51:14 +0800 Subject: [PATCH] remove repeat hash jump --- site/theme/template/Content/MainContent.jsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index 7d1ef124f2..a94575b1d3 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -61,20 +61,9 @@ export default class MainContent extends React.Component { if (!location.hash) { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; - } else { - if (this.timer) { - clearTimeout(this.timer); - } - this.timer = setTimeout(() => { - document.getElementById(decodeURI(location.hash.replace('#', ''))).scrollIntoView(); - }, 10); } } - componentWillUnmount() { - clearTimeout(this.timer); - } - handleMenuOpenChange = (openKeys) => { this.setState({ openKeys }); }