aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/resizable
diff options
context:
space:
mode:
authorJyoti Deka <dekajp@gmail.com>2013-12-07 01:39:34 -0500
committerMike Sherov <mike.sherov@gmail.com>2013-12-14 16:08:44 -0500
commitec5f395260c5e4b678d2fe39c5405d466ee8369e (patch)
tree7e86f1b4b2323205fbdd5009030af0a6d75a4735 /tests/unit/resizable
parentdfff0346d9c99c80b9d32a60720ec018677980e3 (diff)
downloadjquery-ui-ec5f395260c5e4b678d2fe39c5405d466ee8369e.tar.gz
jquery-ui-ec5f395260c5e4b678d2fe39c5405d466ee8369e.zip
Resizable: modified to allow resizing when resizables are nested.
Fixes #5025 Closes gh-1149
Diffstat (limited to 'tests/unit/resizable')
-rw-r--r--tests/unit/resizable/resizable_core.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js
index b02e8b4f1..f0b5cea20 100644
--- a/tests/unit/resizable/resizable_core.js
+++ b/tests/unit/resizable/resizable_core.js
@@ -206,4 +206,37 @@ test( "resizable stores correct size when using helper and grid (#9547)", functi
equal( target.height(), 100, "compare height" );
});
+test( "nested resizable", function() {
+ expect( 4 );
+
+ var outer = $( "<div id='outer' style='width:50px'></div>" ),
+ inner = $( "<div id='inner' style='width:30px'></div>" ),
+ target = $( "#resizable1" ),
+ innerHandle,
+ outerHandle;
+
+ outer.appendTo( target );
+ inner.appendTo( outer );
+
+ inner.resizable( { handles : "e" } );
+ outer.resizable( { handles : "e" } );
+ target.resizable( { handles : "e" } );
+
+ innerHandle = $( "#inner > .ui-resizable-e" );
+ outerHandle = $( "#outer > .ui-resizable-e" );
+
+ TestHelpers.resizable.drag( innerHandle, 10 );
+ equal( inner.width(), 40, "compare width of inner element" );
+ TestHelpers.resizable.drag( innerHandle, -10 );
+ equal( inner.width(), 30, "compare width of inner element" );
+
+ TestHelpers.resizable.drag( outerHandle, 10 );
+ equal( outer.width(), 60, "compare width of outer element" );
+ TestHelpers.resizable.drag( outerHandle, -10 );
+ equal( outer.width(), 50, "compare width of outer element" );
+
+ inner.remove();
+ outer.remove();
+});
+
})(jQuery);