Skip to content

Commit

Permalink
support maskStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Aug 8, 2016
1 parent f81d934 commit d214f43
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -95,6 +95,12 @@ ReactDOM.render(
<td>{}</td>
<td>body style for dialog body element.Such as height</td>
</tr>
<tr>
<td>maskStyle</td>
<td>Object</td>
<td>{}</td>
<td>style for mask element.</td>
</tr>
<tr>
<td>visible</td>
<td>Boolean</td>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "rc-dialog",
"version": "6.2.2",
"version": "6.2.3",
"description": "dialog ui component for react",
"keywords": [
"react",
Expand Down
10 changes: 9 additions & 1 deletion src/Dialog.jsx
Expand Up @@ -69,6 +69,7 @@ const Dialog = React.createClass({
visible: PropTypes.bool,
mousePosition: PropTypes.object,
wrapStyle: PropTypes.object,
maskStyle: PropTypes.object,
prefixCls: PropTypes.string,
wrapClassName: PropTypes.string,
},
Expand Down Expand Up @@ -261,14 +262,21 @@ const Dialog = React.createClass({
};
},

getMaskStyle() {
return {
...this.getZIndexStyle(),
...this.props.maskStyle,
};
},

getMaskElement() {
const props = this.props;
let maskElement;
if (props.mask) {
const maskTransition = this.getMaskTransitionName();
maskElement = (
<LazyRenderBox
style={this.getZIndexStyle()}
style={this.getMaskStyle()}
key="mask"
className={`${props.prefixCls}-mask`}
hiddenClassName={`${props.prefixCls}-mask-hidden`}
Expand Down

0 comments on commit d214f43

Please sign in to comment.