diff options
author | TJ VanToll <tj.vantoll@gmail.com> | 2014-07-15 15:16:26 -0400 |
---|---|---|
committer | TJ VanToll <tj.vantoll@gmail.com> | 2014-07-15 15:49:15 -0400 |
commit | 3ca32b2ad8a3366d14317eb767e89d28254e97a4 (patch) | |
tree | 5aba1ae78a321814806f21d3c0de6ce5eef3a733 /tests/unit | |
parent | 7594a3142547e078326872cb0d6e2d7f32f4c808 (diff) | |
download | jquery-ui-3ca32b2ad8a3366d14317eb767e89d28254e97a4.tar.gz jquery-ui-3ca32b2ad8a3366d14317eb767e89d28254e97a4.zip |
Draggable: Manage ui-draggable-handle correctly in nested instances
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index beab67f19..dd526e5ec 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -291,4 +291,17 @@ test( "ui-draggable-handle assigned to appropriate element", function() { ok( !element.find( "p" ).hasClass( "ui-draggable-handle" ), "removed in destroy()" ); }); +test( "ui-draggable-handle managed correctly in nested draggables", function() { + expect( 4 ); + var parent = $( "<div><div></div></div>" ).draggable().appendTo( "#qunit-fixture" ), + child = parent.find( "div" ).draggable(); + + ok( parent.hasClass( "ui-draggable-handle" ), "parent has class name on init" ); + ok( child.hasClass( "ui-draggable-handle" ), "child has class name on init" ); + + parent.draggable( "destroy" ); + ok( !parent.hasClass( "ui-draggable-handle" ), "parent loses class name on destroy" ); + ok( child.hasClass( "ui-draggable-handle" ), "child retains class name on destroy" ); +}); + })( jQuery ); |