mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Added tests for opacity and zIndex
This commit is contained in:
parent
f616b62a5d
commit
5f26d83c78
@ -942,6 +942,30 @@ test("{ opacity: 0.5 }", function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("opacity, default, switching after initialization", function() {
|
||||||
|
|
||||||
|
expect(3);
|
||||||
|
|
||||||
|
var opacity = null,
|
||||||
|
el = $("#draggable2").draggable({
|
||||||
|
start: function() {
|
||||||
|
opacity = $(this).css("opacity");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
TestHelpers.draggable.move( el, 1, 1 );
|
||||||
|
equal( opacity, 1 );
|
||||||
|
|
||||||
|
el.draggable( "option", "opacity", 0.5 );
|
||||||
|
TestHelpers.draggable.move( el, 2, 1 );
|
||||||
|
equal( opacity, 0.5 );
|
||||||
|
|
||||||
|
el.draggable( "option", "opacity", false );
|
||||||
|
TestHelpers.draggable.move( el, 3, 1 );
|
||||||
|
equal( opacity, 1 );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
test("{ zIndex: 10 }", function() {
|
test("{ zIndex: 10 }", function() {
|
||||||
|
|
||||||
expect(1);
|
expect(1);
|
||||||
@ -964,4 +988,30 @@ test("{ zIndex: 10 }", function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("zIndex, default, switching after initialization", function() {
|
||||||
|
|
||||||
|
expect(3);
|
||||||
|
|
||||||
|
var zindex = null,
|
||||||
|
el = $("#draggable2").draggable({
|
||||||
|
start: function() {
|
||||||
|
zindex = $(this).css("z-index");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
el.css( "z-index", 1 );
|
||||||
|
|
||||||
|
TestHelpers.draggable.move( el, 1, 1 );
|
||||||
|
equal( zindex, 1 );
|
||||||
|
|
||||||
|
el.draggable( "option", "zIndex", 5 );
|
||||||
|
TestHelpers.draggable.move( el, 2, 1 );
|
||||||
|
equal( zindex, 5 );
|
||||||
|
|
||||||
|
el.draggable( "option", "zIndex", false );
|
||||||
|
TestHelpers.draggable.move( el, 3, 1 );
|
||||||
|
equal( zindex, 1 );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
Loading…
Reference in New Issue
Block a user