Tabs: Calculate border and padding on tabs container. Fixed #8836: Height overflows parent with heightStyle: 'fill'.

This commit is contained in:
David Petersen 2012-11-25 19:02:36 -06:00 committed by Scott González
parent ee8d20ea06
commit 6121683d80
2 changed files with 11 additions and 1 deletions

View File

@ -235,10 +235,18 @@ test( "{ heightStyle: 'content' }", function() {
});
test( "{ heightStyle: 'fill' }", function() {
expect( 2 );
expect( 4 );
$( "#tabs8Wrapper" ).height( 500 );
var element = $( "#tabs8" ).tabs({ heightStyle: "fill" });
equalHeight( element, 485 );
element.tabs( "destroy" );
element = $( "#tabs8" ).css({
"border": "1px solid black",
"padding": "1px 0"
});
element.tabs({ heightStyle: "fill" });
equalHeight( element, 481 );
});
test( "{ heightStyle: 'fill' } with sibling", function() {

View File

@ -497,6 +497,8 @@ $.widget( "ui.tabs", {
if ( heightStyle === "fill" ) {
maxHeight = parent.height();
maxHeight -= this.element.outerHeight() - this.element.height();
this.element.siblings( ":visible" ).each(function() {
var elem = $( this ),
position = elem.css( "position" );