aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-22 00:28:06 +0800
committerFabio Berger <me@fabioberger.com>2017-12-22 00:28:06 +0800
commit3e91773cd94162fca1855638a76d7bd2f510558a (patch)
treef8dc443b35a6c306d917c17a63724522d4ccd8a1 /packages/website/ts/pages/shared
parent66cf60f9cb62828e67135835e13b12d8099a66b4 (diff)
downloaddexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar.gz
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar.bz2
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar.lz
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar.xz
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.tar.zst
dexon-sol-tools-3e91773cd94162fca1855638a76d7bd2f510558a.zip
Add sectionName prefix to all anchor links in order to fix method name collisions between sections
Diffstat (limited to 'packages/website/ts/pages/shared')
-rw-r--r--packages/website/ts/pages/shared/nested_sidebar_menu.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
index fcbfaf1cf..42e087e2a 100644
--- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
+++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx
@@ -130,7 +130,8 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
return (
<ul style={{margin: 0, listStyleType: 'none', paddingLeft: 0}} key={menuItemName}>
{_.map(entityNames, entityName => {
- const id = utils.getIdFromName(entityName);
+ const name = `${menuItemName}-${entityName}`;
+ const id = utils.getIdFromName(name);
return (
<li key={`menuItem-${entityName}`}>
<ScrollLink
@@ -138,10 +139,10 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
offset={0}
duration={constants.DOCS_SCROLL_DURATION_MS}
containerId={constants.DOCS_CONTAINER_ID}
- onTouchTap={this.onMenuItemClick.bind(this, entityName)}
+ onTouchTap={this.onMenuItemClick.bind(this, name)}
>
<MenuItem
- onTouchTap={this.onMenuItemClick.bind(this, menuItemName)}
+ onTouchTap={this.onMenuItemClick.bind(this, name)}
style={{minHeight: 35}}
innerDivStyle={{paddingLeft: 36, fontSize: 14, lineHeight: '35px'}}
>
@@ -154,8 +155,8 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</ul>
);
}
- private onMenuItemClick(menuItemName: string): void {
- const id = utils.getIdFromName(menuItemName);
+ private onMenuItemClick(name: string): void {
+ const id = utils.getIdFromName(name);
utils.setUrlHash(id);
this.props.onMenuItemClick();
}