Skip to content

Commit

Permalink
Tabs: Show panels on destroy. Fixes #8795 - Tabs: 'display: none;' at…
Browse files Browse the repository at this point in the history
…tribute is not removed from tabs when destroy is called.
  • Loading branch information
scottgonzalez committed Nov 9, 2012
1 parent dbaecf0 commit fd48568
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/unit/testsuite.js
Expand Up @@ -205,6 +205,33 @@ window.domEqual = function( selector, modifier, message ) {
"title"
];

function getElementStyles( elem ) {
var key, len,
style = elem.ownerDocument.defaultView ?
elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
elem.currentStyle,
styles = {};

if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
len = style.length;
while ( len-- ) {
key = style[ len ];
if ( typeof style[ key ] === "string" ) {
styles[ $.camelCase( key ) ] = style[ key ];
}
}
// support: Opera, IE <9
} else {
for ( key in style ) {
if ( typeof style[ key ] === "string" ) {
styles[ key ] = style[ key ];
}
}
}

return styles;
}

function extract( elem ) {
if ( !elem || !elem.length ) {
QUnit.push( false, actual, expected,
Expand All @@ -222,6 +249,7 @@ window.domEqual = function( selector, modifier, message ) {
var value = elem.attr( attr );
result[ attr ] = value !== undefined ? value : "";
});
result.style = getElementStyles( elem[ 0 ] );
result.events = $._data( elem[ 0 ], "events" );
result.data = $.extend( {}, elem.data() );
delete result.data[ $.expando ];
Expand Down
2 changes: 2 additions & 0 deletions ui/jquery.ui.tabs.js
Expand Up @@ -716,6 +716,8 @@ $.widget( "ui.tabs", {
}
});

this.panels.show();

if ( this.options.heightStyle !== "content" ) {
this.panels.css( "height", "" );
}
Expand Down

0 comments on commit fd48568

Please sign in to comment.