mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Position: Guard against passing window to offset
Starting in jQuery 3.0 this will throw an error Fixes #13493 Closes gh-1565
This commit is contained in:
parent
bec722abdb
commit
b3a9b13a21
@ -142,12 +142,13 @@ $.position = {
|
||||
getWithinInfo: function( element ) {
|
||||
var withinElement = $( element || window ),
|
||||
isWindow = $.isWindow( withinElement[ 0 ] ),
|
||||
isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
|
||||
isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
|
||||
hasOffset = !isWindow && !isDocument;
|
||||
return {
|
||||
element: withinElement,
|
||||
isWindow: isWindow,
|
||||
isDocument: isDocument,
|
||||
offset: withinElement.offset() || { left: 0, top: 0 },
|
||||
offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
|
||||
scrollLeft: withinElement.scrollLeft(),
|
||||
scrollTop: withinElement.scrollTop(),
|
||||
width: withinElement.outerWidth(),
|
||||
|
Loading…
Reference in New Issue
Block a user