diff options
author | Richard D. Worth <rdworth@gmail.com> | 2011-05-26 04:58:15 -0400 |
---|---|---|
committer | Richard D. Worth <rdworth@gmail.com> | 2011-05-26 04:58:15 -0400 |
commit | de3fc0050ee672ce155f0dd65ee9ecdfd818c063 (patch) | |
tree | 5ea5a384ee5290b13223872da412966925899902 /tests | |
parent | fe4ae3045810421d2489175739098deb6852417b (diff) | |
download | jquery-ui-de3fc0050ee672ce155f0dd65ee9ecdfd818c063.tar.gz jquery-ui-de3fc0050ee672ce155f0dd65ee9ecdfd818c063.zip |
Simulate: account for document scroll in findCenter function. Fixes #6859 - Jquery.Simulate drag behaves incorrect when container scrolled
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jquery.simulate.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index a88b6cbe4..bb82624d3 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -123,10 +123,10 @@ $.extend($.simulate.prototype, { this.simulateEvent(target, "click", coord); }, findCenter: function(el) { - var el = $(this.target), o = el.offset(); + var el = $(this.target), o = el.offset(), d = $(document); return { - x: o.left + el.outerWidth() / 2, - y: o.top + el.outerHeight() / 2 + x: o.left + el.outerWidth() / 2 - d.scrollLeft(), + y: o.top + el.outerHeight() / 2 - d.scrollTop() }; } }); |