mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-07 06:14:24 +00:00
Resizable: Fix aspectRatio cannot be changed after initialization.
Add tests for setting aspectRatio numeric value. Fixes #4186
This commit is contained in:
parent
ffeb5aba12
commit
02796d6dac
@ -156,7 +156,7 @@ QUnit.test( "aspectRatio: Resizing can move objects", function( assert ) {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( "aspectRatio: aspectRatio can be changed after initialization", function( assert ) {
|
QUnit.test( "aspectRatio: aspectRatio can be changed after initialization", function( assert ) {
|
||||||
assert.expect( 2 );
|
assert.expect( 4 );
|
||||||
|
|
||||||
var target = $( "#resizable1" )
|
var target = $( "#resizable1" )
|
||||||
.resizable( { aspectRatio: 1 } )
|
.resizable( { aspectRatio: 1 } )
|
||||||
@ -168,6 +168,13 @@ QUnit.test( "aspectRatio: aspectRatio can be changed after initialization", func
|
|||||||
|
|
||||||
assert.equal( target.width(), 180, "compare width - size change" );
|
assert.equal( target.width(), 180, "compare width - size change" );
|
||||||
assert.equal( target.height(), 100, "compare height - no size change" );
|
assert.equal( target.height(), 100, "compare height - no size change" );
|
||||||
|
|
||||||
|
target.resizable( "option", "aspectRatio", 2 );
|
||||||
|
|
||||||
|
testHelper.drag( handle, -40 );
|
||||||
|
|
||||||
|
assert.equal( target.width(), 140, "compare width - size change" );
|
||||||
|
assert.equal( target.height(), 70, "compare height - size change in proper relation" );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( "containment", function( assert ) {
|
QUnit.test( "containment", function( assert ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user