Merge pull request #339 from necinc/dev

Added a few more events to Dialog's overlay
old
Javi Velasco 2016-03-05 15:38:13 +01:00
commit d1320d5517
2 changed files with 13 additions and 1 deletions

View File

@ -15,7 +15,13 @@ const Dialog = (props) => {
}, props.className);
return (
<Overlay active={props.active} onClick={props.onOverlayClick}>
<Overlay
active={props.active}
onClick={props.onOverlayClick}
onMouseDown={props.onOverlayMouseDown}
onMouseUp={props.onOverlayMouseUp}
onMouseMove={props.onOverlayMouseMove}
>
<div data-react-toolbox='dialog' className={className}>
<section role='body' className={style.body}>
{props.title ? <h6 className={style.title}>{props.title}</h6> : null}
@ -35,6 +41,9 @@ Dialog.propTypes = {
children: React.PropTypes.node,
className: React.PropTypes.string,
onOverlayClick: React.PropTypes.func,
onOverlayMouseDown: React.PropTypes.func,
onOverlayMouseUp: React.PropTypes.func,
onOverlayMouseMove: React.PropTypes.func,
title: React.PropTypes.string,
type: React.PropTypes.string
};

View File

@ -41,5 +41,8 @@ class DialogTest extends React.Component {
| `actions` | `Array` | `[]` | A array of objects representing the buttons for the dialog navigation area. The properties will be transferred to the buttons.|
| `className` | `String` | `''` | Sets a class to give customized styles to the dialog.|
| `onOverlayClick` | `Function` | | Callback to be invoked when the dialog overlay is clicked.|
| `onOverlayMouseDown` | `Function` | | Callback called when the mouse button is pressed on the overlay. |
| `onOverlayMouseUp` | `Function` | | Callback called when the mouse button is released over the overlay. |
| `onOverlayMouseMove` | `Function` | | Callback called when the mouse is moving over the overlay. |
| `title` | `String` | | The text string to use as standar title of the dialog.|
| `type` | `String` | `normal` | Used to determine the size of the dialog. It can be `small`, `normal` or `large`. |