rc-menu
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -10,8 +10,8 @@ /** @jsx React.DOM */ | ||
function handleSelect(selectedKey) { | ||
console.log('selected ' + selectedKey); | ||
function handleSelect(selectedKey, item, e) { | ||
console.log('selected ' + selectedKey, item, e); | ||
} | ||
function handleDeselect(selectedKey) { | ||
console.log('deselect ' + selectedKey); | ||
function handleDeselect(selectedKey, item, e) { | ||
console.log('deselect ' + selectedKey, item, e); | ||
} | ||
@@ -18,0 +18,0 @@ |
@@ -48,3 +48,3 @@ /** @jsx React.DOM */ | ||
this.state = { | ||
activeKey: getActiveKey.call(this,props), | ||
activeKey: getActiveKey.call(this, props), | ||
selectedKeys: props.selectedKeys || [] | ||
@@ -60,3 +60,3 @@ }; | ||
this.setState({ | ||
activeKey: getActiveKey.call(this,nextProps), | ||
activeKey: getActiveKey.call(this, nextProps), | ||
selectedKeys: nextProps.selectedKeys || [] | ||
@@ -148,3 +148,3 @@ }); | ||
handleSelect(key, child) { | ||
handleSelect(key, child, e) { | ||
var props = this.props; | ||
@@ -158,3 +158,3 @@ // not from submenu | ||
var selectedDescendantProps = selectedDescendant.props; | ||
selectedDescendantProps.onDeselect(selectedDescendantProps.eventKey, selectedDescendant); | ||
selectedDescendantProps.onDeselect(selectedDescendantProps.eventKey, selectedDescendant, e); | ||
} | ||
@@ -179,7 +179,7 @@ } | ||
if (props.onSelect) { | ||
props.onSelect(key, child); | ||
props.onSelect(key, child, e); | ||
} | ||
} | ||
handleDeselect(key, child) { | ||
handleDeselect(key, child, e) { | ||
var state = this.state; | ||
@@ -198,3 +198,3 @@ var selectedKeys = state.selectedKeys; | ||
if (this.props.onDeselect) { | ||
this.props.onDeselect(key, child); | ||
this.props.onDeselect(key, child, e); | ||
} | ||
@@ -201,0 +201,0 @@ } |
@@ -12,3 +12,3 @@ /** @jsx React.DOM */ | ||
super(props); | ||
['handleKeyDown', 'handleMouseLeave', 'handleMouseEnter','handleClick'].forEach((m)=> { | ||
['handleKeyDown', 'handleMouseLeave', 'handleMouseEnter', 'handleClick'].forEach((m)=> { | ||
this[m] = this[m].bind(this); | ||
@@ -51,13 +51,13 @@ }); | ||
handleClick() { | ||
handleClick(e) { | ||
var props = this.props; | ||
if (props.multiple) { | ||
if (props.selected) { | ||
props.onDeselect(props.eventKey, this); | ||
props.onDeselect(props.eventKey, this, e); | ||
} else { | ||
props.onSelect(props.eventKey, this); | ||
props.onSelect(props.eventKey, this,e); | ||
} | ||
} else { | ||
if (!props.selected) { | ||
props.onSelect(props.eventKey, this); | ||
props.onSelect(props.eventKey, this,e); | ||
} | ||
@@ -64,0 +64,0 @@ } |
@@ -124,8 +124,8 @@ /** @jsx React.DOM */ | ||
handleSelect(childKey, child) { | ||
this.props.onSelect(childKey, child); | ||
handleSelect(childKey, child, e) { | ||
this.props.onSelect(childKey, child, e); | ||
}, | ||
handleDeselect(childKey, child) { | ||
this.props.onDeselect(childKey, child); | ||
handleDeselect(childKey, child, e) { | ||
this.props.onDeselect(childKey, child, e); | ||
}, | ||
@@ -132,0 +132,0 @@ |
{ | ||
"name": "rc-menu", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "menu ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38700