From 52a052be79d21aa519ccb513dc00a7c54868ef03 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 27 Aug 2010 13:34:14 -0400 Subject: Position: Handle $(document) and $(window) for the of option. Fixes #5963 - Position: option 'of' accepts jQuery object unless it wraps document. Fixes #5655 - (Possible) Typo in jquery.ui.position 1.8.1. --- tests/unit/position/position_core.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js index 3976e43ab..426231ee3 100644 --- a/tests/unit/position/position_core.js +++ b/tests/unit/position/position_core.js @@ -128,6 +128,17 @@ test('of', function() { left: $(document).width() - 10 }, 'document'); + $('#elx').position({ + my: 'right bottom', + at: 'right bottom', + of: $(document), + collision: 'none' + }); + same($('#elx').offset(), { + top: $(document).height() - 10, + left: $(document).width() - 10 + }, 'document'); + $('#elx').position({ my: 'right bottom', at: 'right bottom', @@ -139,6 +150,17 @@ test('of', function() { left: $(window).width() - 10 }, 'window'); + $('#elx').position({ + my: 'right bottom', + at: 'right bottom', + of: $(window), + collision: 'none' + }); + same($('#elx').offset(), { + top: $(window).height() - 10, + left: $(window).width() - 10 + }, 'window'); + $(window).scrollTop(500).scrollLeft(200); $('#elx').position({ my: 'right bottom', -- cgit v1.2.3