Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll enhancements #16

Merged
merged 1 commit into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function hashLinkScroll() {
const element = document.getElementById(id);
if (element) {
element.scrollIntoView();
window.scrollBy(0, -60); // Offset for header
}
}, 0);
}
Expand All @@ -52,6 +53,8 @@ function onRouterUpdate() {
}

export function init() {
setTimeout(() => hashLinkScroll(), 0);

render(
<Router
history={browserHistory}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/Method.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export default function Method(props) {
}

return (
<div className="Method">
<h2 id={name}>{name}</h2>
<div id={name} className="Method">
<h2>{name}</h2>
<div className="Method-section">
<p className="Method-description">{description}</p>
</div>
Expand Down