Initial context menu with all it's elements
This commit is contained in:
parent
6e7e091117
commit
8246d9148c
2 changed files with 12 additions and 1 deletions
|
@ -72,11 +72,20 @@ module.exports = {
|
|||
'mx_ContextualMenu_right': !props.left,
|
||||
});
|
||||
|
||||
var menuSize = {};
|
||||
if (props.menuWidth) {
|
||||
menuSize.width = props.menuWidth;
|
||||
}
|
||||
|
||||
if (props.menuHeight) {
|
||||
menuSize.height = props.menuHeight;
|
||||
}
|
||||
|
||||
// FIXME: If a menu uses getDefaultProps it clobbers the onFinished
|
||||
// property set here so you can't close the menu from a button click!
|
||||
var menu = (
|
||||
<div className={className} style={position}>
|
||||
<div className={menuClasses}>
|
||||
<div className={menuClasses} style={menuSize}>
|
||||
{chevron}
|
||||
<Element {...props} onFinished={closeMenu}/>
|
||||
</div>
|
||||
|
|
|
@ -87,6 +87,8 @@ module.exports = React.createClass({
|
|||
var y = (elementRect.top + (elementRect.height / 2) + window.pageYOffset) - 43;
|
||||
var self = this;
|
||||
ContextualMenu.createMenu(Menu, {
|
||||
menuWidth: 188,
|
||||
menuHeight: 126,
|
||||
chevronOffset: 35,
|
||||
left: x,
|
||||
top: y,
|
||||
|
|
Loading…
Reference in a new issue