mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 08:43:02 +00:00
2.0.1 Beta
This commit is contained in:
@@ -9,7 +9,7 @@ import cn from 'classnames';
|
||||
* @return {boolean} If matches
|
||||
*/
|
||||
function isActive(href) {
|
||||
return encodeURI(href) == (window.location.pathname + window.location.search);
|
||||
return href == (window.location.pathname + window.location.search);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,13 +22,12 @@ export default class ActiveLink extends Link {
|
||||
* @return {React.Component} The active link
|
||||
*/
|
||||
render() {
|
||||
let action = this.handler.bind(this);
|
||||
let className = this.props.className;
|
||||
if (isActive(this.props.href)) {
|
||||
className = cn(className, 'active');
|
||||
}
|
||||
|
||||
return <a {...this.props} className={className} onTouchTap={action}>{this.props.children}</a>;
|
||||
return <a {...this.props} className={className} onClick={this.handler}>{this.props.children}</a>;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user