aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-11-09 14:52:57 -0500
committerScott González <scott.gonzalez@gmail.com>2012-11-09 14:52:57 -0500
commitfd48568c402847df8af59166c33549f0d19feb4b (patch)
tree747f074dc42ffe8b27bea27cfcc7f57c0dca7e64
parentdbaecf0ede6e8dcd6e80adfb2bd8826ddd648136 (diff)
downloadjquery-ui-fd48568c402847df8af59166c33549f0d19feb4b.tar.gz
jquery-ui-fd48568c402847df8af59166c33549f0d19feb4b.zip
Tabs: Show panels on destroy. Fixes #8795 - Tabs: 'display: none;' attribute is not removed from tabs when destroy is called.
-rw-r--r--tests/unit/testsuite.js28
-rw-r--r--ui/jquery.ui.tabs.js2
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js
index c0ab490e1..bf17670f7 100644
--- a/tests/unit/testsuite.js
+++ b/tests/unit/testsuite.js
@@ -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,
@@ -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 ];
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 49b6d7bf1..5b5227128 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -716,6 +716,8 @@ $.widget( "ui.tabs", {
}
});
+ this.panels.show();
+
if ( this.options.heightStyle !== "content" ) {
this.panels.css( "height", "" );
}