diff options
author | Patricia Juarez <patrixd@gmail.com> | 2013-11-14 13:40:57 +0100 |
---|---|---|
committer | TJ VanToll <tj.vantoll@gmail.com> | 2015-03-03 08:52:21 -0500 |
commit | 18e301f4e29c2080e9aa9dac87c00dee137cb6c9 (patch) | |
tree | 8e5371952c3b902654d543ebbc8d68803a5c21bf /tests | |
parent | 4b017b414f107ed3c1dafc7601b61cbcd76acf61 (diff) | |
download | jquery-ui-18e301f4e29c2080e9aa9dac87c00dee137cb6c9.tar.gz jquery-ui-18e301f4e29c2080e9aa9dac87c00dee137cb6c9.zip |
Resizable: Modified to allow jquery objects as handles
Custom handlers did not work as jquery objects (outside the resizable element)
Fixes #9658
Closes gh-1445
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/resizable/resizable.html | 1 | ||||
-rw-r--r-- | tests/unit/resizable/resizable_options.js | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/resizable/resizable.html b/tests/unit/resizable/resizable.html index 5668c909a..a44346e7c 100644 --- a/tests/unit/resizable/resizable.html +++ b/tests/unit/resizable/resizable.html @@ -69,6 +69,7 @@ <div id="container"> <div id="resizable1">I'm a resizable.</div> + <div id="resizer1" class="ui-resizable-handle ui-resizable-s"></div> </div> <div id="container2"> diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js index cacebf05c..a2c95790b 100644 --- a/tests/unit/resizable/resizable_options.js +++ b/tests/unit/resizable/resizable_options.js @@ -374,6 +374,35 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 equal( target.height(), 100, "compare maxHeight" ); }); + +test( "custom handles { handles: { 's': $('#resizer1'), containment: 'parent' }", function () { + expect( 2 ); + + var handle = "#resizer1", + target = $( "#resizable1" ).resizable({ handles: { "s": $( "#resizer1" ) }, containment: "parent" }); + + TestHelpers.resizable.drag( handle, 0, 70 ); + equal( target.height(), 170, "compare height" ); + + TestHelpers.resizable.drag( handle, 0, -70 ); + equal( target.height(), 100, "compare height" ); +}); + + +test( "custom handles { handles: { 's': $('#resizer1')[0], containment: 'parent' }", function () { + expect( 2 ); + + var handle = "#resizer1", + target = $( "#resizable1" ).resizable({ handles: { "s": $( "#resizer1" )[ 0 ] }, containment: "parent" }); + + TestHelpers.resizable.drag( handle, 0, 70 ); + equal( target.height(), 170, "compare height" ); + + TestHelpers.resizable.drag( handle, 0, -70 ); + equal( target.height(), 100, "compare height" ); +}); + + test("zIndex, applied to all handles", function() { expect(8); |