fix menu click

This commit is contained in:
afc163 2015-11-14 15:33:29 +08:00
parent 62243ab38b
commit ed1bb1b97b
2 changed files with 11 additions and 15 deletions

View File

@ -12,7 +12,8 @@ const AntMenu = React.createClass({
onClick: noop,
onOpen: noop,
onClose: noop,
theme: 'light' // or dark
className: '',
theme: 'light', // or dark
};
},
getInitialState() {
@ -58,12 +59,12 @@ const AntMenu = React.createClass({
onClick: this.handleClick,
onOpen: this.handleOpenKeys,
onClose: this.handleCloseKeys,
className: this.props.prefixCls + '-' + this.props.theme,
};
const className = this.props.className + ' ' + this.props.prefixCls + '-' + this.props.theme;
if (this.props.mode === 'inline') {
return <Menu {...this.props} {...props} openAnimation={openAnimation} />;
return <Menu {...this.props} className={className} openAnimation={openAnimation} />;
} else {
return <Menu {...this.props} {...props} openTransitionName={openAnimation} />;
return <Menu {...this.props} {...props} className={className} openTransitionName={openAnimation} />;
}
}
});

View File

@ -32,15 +32,7 @@
transition: all 0.3s ease;
}
&-inline > &-item-active,
&-submenu-inline&-submenu-active,
&-submenu-inline&-submenu-active > &-submenu-title:hover {
background-color: #fff;
}
&-inline > &-item-active:hover,
&-item-active,
&-submenu-active,
&-submenu-inline&-submenu-active > &-submenu-title:hover {
background-color: tint(@primary-color, 90%);
}
@ -62,14 +54,17 @@
z-index: 1;
}
.@{menu-prefix-cls}-item-selected {
color: @primary-color;
}
}
&-inline {
.@{menu-prefix-cls}-selected,
.@{menu-prefix-cls}-item-active {
border-right: 2px solid @primary-color;
}
.@{menu-prefix-cls}-item-selected {
background-color: tint(@primary-color, 90%);
color: @primary-color;
border-right: 2px solid @primary-color;
}
}