Skip to content

Commit

Permalink
fix(popup): pre-existing popup positioning inside tables
Browse files Browse the repository at this point in the history
Behaviour of jQuery.position has issue from jQuery v3.3.0.
This PR updated positioning logic to work regardless of jQuery versions.
  • Loading branch information
exoego authored May 26, 2020
1 parent 8193091 commit feed67a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,10 @@ $.fn.popup = function(parameters) {
$popupOffsetParent = module.get.offsetParent($popup),
targetElement = $target[0],
isWindow = ($boundary[0] == window),
targetPosition = (settings.inline || (settings.popup && settings.movePopup))
? $target.position()
: $target.offset(),
targetOffset = $target.offset(),
parentOffset = settings.inline || (settings.popup && settings.movePopup)
? $target.offsetParent().offset()
: { top: 0, left: 0 },
screenPosition = (isWindow)
? { top: 0, left: 0 }
: $boundary.offset(),
Expand All @@ -528,8 +529,8 @@ $.fn.popup = function(parameters) {
element : $target[0],
width : $target.outerWidth(),
height : $target.outerHeight(),
top : targetPosition.top,
left : targetPosition.left,
top : targetOffset.top - parentOffset.top,
left : targetOffset.left - parentOffset.left,
margin : {}
},
// popup itself
Expand Down

0 comments on commit feed67a

Please sign in to comment.