Skip to content

Commit

Permalink
Add prop onAlign
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Apr 5, 2016
1 parent 88d5be8 commit 30e0296
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ ReactDOM.render(<Trigger align={{
<td></td>
<td>builtin placement align map. used by placement prop</td>
</tr>
<tr>
<td>onAlign</td>
<td>function(popupDomNode, align)</td>
<td></td>
<td>callback when popup node is aligned</td>
</tr>
</tbody>
</table>

Expand Down
4 changes: 4 additions & 0 deletions src/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Popup = React.createClass({
className: PropTypes.string,
prefixCls: PropTypes.string,
onMouseLeave: PropTypes.func,
onAlign: PropTypes.func,
},

componentDidMount() {
Expand All @@ -31,6 +32,9 @@ const Popup = React.createClass({
this.currentAlignClassName = currentAlignClassName;
popupDomNode.className = this.getClassName(currentAlignClassName);
}
if (typeof props.onAlign === 'function') {
props.onAlign(popupDomNode, align);
}
},

getPopupDomNode() {
Expand Down

0 comments on commit 30e0296

Please sign in to comment.