Skip to content

Commit

Permalink
vertical popup offset
Browse files Browse the repository at this point in the history
  • Loading branch information
goloveychuk committed Jan 11, 2017
1 parent 4fc18ec commit 5018301
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/Popup/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class Popup extends Component {
/** The node where the popup should mount.. */
hideOnScroll: PropTypes.bool,

/** Horizontal offset in pixels to be applied to the popup */
/** Horizontal or vertical offset in pixels to be applied to the popup */
offset: PropTypes.number,

/** Event triggering the popup */
Expand Down Expand Up @@ -182,8 +182,12 @@ export default class Popup extends Component {
if (offset) {
if (_.isNumber(style.right)) {
style.right -= offset
} else {
} else if (_.isNumber(style.left)) {
style.left -= offset
} else if (_.isNumber(style.top)) {
style.top -= offset
} else if (_.isNumber(style.bottom)) {
style.bottom -= offset
}
}

Expand Down

0 comments on commit 5018301

Please sign in to comment.