diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2014-08-14 21:17:28 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-08-19 15:15:21 -0400 |
commit | 451dded230c3832a1baacc89333727b25c44cfc7 (patch) | |
tree | cb6ba4c421808a7f7d4595cd3dfb84150f6f8365 /tests | |
parent | 8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5 (diff) | |
download | jquery-ui-451dded230c3832a1baacc89333727b25c44cfc7.tar.gz jquery-ui-451dded230c3832a1baacc89333727b25c44cfc7.zip |
Draggable: Ensure helper is positioned even if its the element itself
Fixes #9446
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/draggable/draggable_options.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 1b7dc2b3b..8f4bd3bbb 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -701,6 +701,25 @@ test( "helper, default, switching after initialization", function() { TestHelpers.draggable.shouldMove( element, "helper: original" ); }); +// http://bugs.jqueryui.com/ticket/9446 +// Draggable: helper function cannot emulate default behavior +test( "helper, function returning original element", function() { + expect( 1 ); + + var element = $( "#draggable1" ).css( "position", "static" ).draggable({ + helper: function() { + return this; + } + }); + + TestHelpers.draggable.testDragHelperOffset( element, 100, 100, 100, 100, "original element is draggable" ); + + element.simulate( "drag", { + dx: 100, + dy: 100 + }); +}); + function testHelperPosition( scrollPositions, position, helper, scrollElements, scrollElementsTitle ) { test( "{ helper: '" + helper + "' }, " + position + ", with scroll offset on " + scrollElementsTitle, function() { expect( scrollPositions.length * 2 ); |