diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-20 00:09:13 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-20 00:09:13 +0800 |
commit | 90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5 (patch) | |
tree | 2f49b56924186ad738a6944c100d17cda1ad39fb | |
parent | 16ba01cd2e8b2af7bdeb6779e913ea4b6453dd78 (diff) | |
download | dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar.gz dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar.bz2 dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar.lz dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar.xz dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.tar.zst dexon-sol-tools-90ba8e0e8df2ccd2907adfcb143ed954b9d0b4c5.zip |
Remove unused listeners
-rw-r--r-- | packages/react-docs/src/components/doc_reference.tsx | 10 | ||||
-rw-r--r-- | packages/website/ts/pages/wiki/wiki.tsx | 8 |
2 files changed, 0 insertions, 18 deletions
diff --git a/packages/react-docs/src/components/doc_reference.tsx b/packages/react-docs/src/components/doc_reference.tsx index 00b1286a4..85547576b 100644 --- a/packages/react-docs/src/components/doc_reference.tsx +++ b/packages/react-docs/src/components/doc_reference.tsx @@ -52,12 +52,6 @@ export interface DocReferenceProps { export interface DocReferenceState {} export class DocReference extends React.Component<DocReferenceProps, DocReferenceState> { - public componentDidMount(): void { - window.addEventListener('hashchange', this._onHashChanged.bind(this), false); - } - public componentWillUnmount(): void { - window.removeEventListener('hashchange', this._onHashChanged.bind(this), false); - } public componentDidUpdate(prevProps: DocReferenceProps, _prevState: DocReferenceState): void { if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) { const hash = window.location.hash.slice(1); @@ -323,8 +317,4 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc /> ); } - private _onHashChanged(_event: any): void { - const hash = window.location.hash.slice(1); - sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); - } } diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx index e62300ddf..a35404e33 100644 --- a/packages/website/ts/pages/wiki/wiki.tsx +++ b/packages/website/ts/pages/wiki/wiki.tsx @@ -49,9 +49,6 @@ export class Wiki extends React.Component<WikiProps, WikiState> { isHoveringSidebar: false, }; } - public componentDidMount(): void { - window.addEventListener('hashchange', this._onHashChanged.bind(this), false); - } public componentWillMount(): void { // tslint:disable-next-line:no-floating-promises this._fetchArticlesBySectionAsync(); @@ -59,7 +56,6 @@ export class Wiki extends React.Component<WikiProps, WikiState> { public componentWillUnmount(): void { this._isUnmounted = true; clearTimeout(this._wikiBackoffTimeoutId); - window.removeEventListener('hashchange', this._onHashChanged.bind(this), false); } public render(): React.ReactNode { const sectionNameToLinks = _.isUndefined(this.state.articlesBySection) @@ -198,8 +194,4 @@ export class Wiki extends React.Component<WikiProps, WikiState> { } return sectionNameToLinks; } - private _onHashChanged(_event: any): void { - const hash = window.location.hash.slice(1); - sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); - } } |