Skip to content

Commit

Permalink
Merge 'jeff-nz-feature/sidebar-badge-on-parent-menus'
Browse files Browse the repository at this point in the history
  • Loading branch information
xidedix committed Oct 8, 2018
2 parents 1f167ea + 43d8fef commit 8693743
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
### [@coreui/react](https://coreui.io/) changelog

##### `v2.0.9`
- feat(Sidebar): badge on parent dropdown - thanks @jeff-nz
- fix(SidebarNav): handleClick() target->currentTarget open
- chore(demo): style.css update to `@coreui/coreui v2.0.15`

##### `v2.0.8`
- refactor(SidebarMinimizer): extract `togglePs` method
- refactor(SidebarMinimizer): for use `togglePs` method
Expand Down
11 changes: 10 additions & 1 deletion demo/src/scss/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coreui/react",
"version": "2.0.8",
"version": "2.0.9",
"description": "CoreUI React Bootstrap 4 components",
"license": "MIT",
"author": {
Expand Down
4 changes: 2 additions & 2 deletions src/SidebarNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AppSidebarNav extends Component {

handleClick(e) {
e.preventDefault();
e.target.parentElement.classList.toggle('open');
e.currentTarget.parentElement.classList.toggle('open');
}

activeRoute(routeName, props) {
Expand Down Expand Up @@ -111,7 +111,7 @@ class AppSidebarNav extends Component {
const classIcon = classNames('nav-icon', item.icon);
return (
<li key={key} className={this.activeRoute(item.url, this.props)}>
<a className="nav-link nav-dropdown-toggle" href="#" onClick={this.handleClick}><i className={classIcon} />{item.name}</a>
<a className="nav-link nav-dropdown-toggle" href="#" onClick={this.handleClick}><i className={classIcon} />{item.name}{this.navBadge(item.badge)}</a>
<ul className="nav-dropdown-items">
{this.navList(item.children)}
</ul>
Expand Down

0 comments on commit 8693743

Please sign in to comment.