Skip to content

Resizable: modified to allow resizing when resizables are nested. Fixes ... #1149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/unit/resizable/resizable_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion ui/jquery.ui.resizable.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $.widget("ui.resizable", $.ui.mouse, {
for(i in this.handles) {

if(this.handles[i].constructor === String) {
this.handles[i] = $(this.handles[i], this.element).show();
this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
}

//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
Expand Down