")
.addClass("ui-resizable-handle")
.addClass("ui-resizable-w")
.append($("
"))
);
var handle = ".ui-resizable-w div", target = $("#resizable1").resizable({ handles: "all" });
TestHelpers.resizable.drag(handle, -50);
equal( target.width(), 150, "compare width" );
TestHelpers.resizable.drag(handle, 50);
equal( target.width(), 100, "compare width" );
});
test("resizable accounts for scroll position correctly (#3815)", function() {
expect( 3 );
var position, top, left,
container = $("
").appendTo("#qunit-fixture"),
overflowed = $("
").appendTo( container ),
el = $("
").appendTo( overflowed ).resizable({ handles: "all" }),
handle = ".ui-resizable-e";
container.scrollLeft( 100 ).scrollTop( 100 );
position = el.position();
left = el.css("left");
top = el.css("top");
TestHelpers.resizable.drag(handle, 50, 50);
deepEqual( el.position(), position, "position stays the same when resized" );
equal( el.css("left"), left, "css('left') stays the same when resized" );
equal( el.css("top"), top, "css('top') stays the same when resized" );
});
test( "resizable stores correct size when using helper and grid (#9547)", function() {
expect( 2 );
var handle = ".ui-resizable-se",
target = $( "#resizable1" ).resizable({
handles: "all",
helper: "ui-resizable-helper",
grid: [ 10, 10 ]
});
TestHelpers.resizable.drag( handle, 1, 1 );
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
})(jQuery);