From f4fd41ef38eb8a3fb86a6eeea10c1fc8c5b4f65f Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 27 Mar 2019 16:31:43 +0100 Subject: [PATCH] reduced TOC, fix scrollspy --- src/templates/Javadoc/Toc.jsx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/templates/Javadoc/Toc.jsx b/src/templates/Javadoc/Toc.jsx index afc41a35..86c45e00 100644 --- a/src/templates/Javadoc/Toc.jsx +++ b/src/templates/Javadoc/Toc.jsx @@ -1,10 +1,10 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import slugify from 'slugify' -// import Scrollspy from 'react-scrollspy' +import Scrollspy from 'react-scrollspy' import Scroll from '../../components/Scroll' import { cleanPaths } from './utils' -// import stylesSidebar from '../../components/Sidebar.module.scss' +import stylesSidebar from '../../components/Sidebar.module.scss' export default class Toc extends PureComponent { static propTypes = { @@ -36,24 +36,27 @@ export default class Toc extends PureComponent { const slug = slugify(cleanedPath, { remove: /[*+~.()'"/!:@]/g }) + let entity = cleanedPath.split('/') + entity = entity.pop() return (
  • - - {cleanedPath} + + {entity} - {/* - {cleanedPath} - */}
  • ) }) render() { - return + return ( + + {this.items} + + ) } }