aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.tabs.js
diff options
context:
space:
mode:
authorKlaus Hartl <klaus.hartl@googlemail.com>2008-10-06 11:41:48 +0000
committerKlaus Hartl <klaus.hartl@googlemail.com>2008-10-06 11:41:48 +0000
commitf02dda5ade3f1f40c2eab02bd429a557e21d6646 (patch)
tree19fd5c388b4c12b2b0e47a80325497199eab6f6c /ui/ui.tabs.js
parenta47c2a87e88e99a3758d0e6e12b95cb3a0d0b774 (diff)
downloadjquery-ui-f02dda5ade3f1f40c2eab02bd429a557e21d6646.tar.gz
jquery-ui-f02dda5ade3f1f40c2eab02bd429a557e21d6646.zip
UI Tabs: fixed removal of inline styles set for a tab panel
Diffstat (limited to 'ui/ui.tabs.js')
-rw-r--r--ui/ui.tabs.js30
1 files changed, 14 insertions, 16 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js
index fedd16908..1052b51d5 100644
--- a/ui/ui.tabs.js
+++ b/ui/ui.tabs.js
@@ -181,34 +181,32 @@ $.widget("ui.tabs", {
else
hideFx = showFx = o.fx || baseFx;
- // reset some styles to maintain print style sheets etc.
- var resetCSS = { display: '', overflow: '', height: '' };
- if (!$.browser.msie) // not in IE to prevent ClearType font issue
- resetCSS.opacity = '';
+ // Reset certain styles left over from animation to
+ // maintain print style sheets and prevent IE's
+ // ClearType bug...
+ function resetStyle($el, fx) {
+ $el.css({ display: '' });
+ if ($.browser.msie && fx.opacity)
+ $el[0].style.filter = '';
+ }
// Hide a tab, animation prevents browser scrolling to fragment,
// $show is optional.
function hideTab(clicked, $hide, $show) {
$hide.animate(hideFx, hideFx.duration || baseDuration, function() { //
- $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && hideFx.opacity)
- $hide[0].style.filter = '';
- if ($show)
- showTab(clicked, $show, $hide);
+ $hide.addClass(o.hideClass);
+ resetStyle($hide, hideFx);
+ if ($show) showTab(clicked, $show, $hide);
});
}
// Show a tab, animation prevents browser scrolling to fragment,
// $hide is optional.
function showTab(clicked, $show, $hide) {
- if (showFx === baseFx)
- $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
+ if (showFx === baseFx) $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox caused by gap between showing and hiding the tab panels
$show.animate(showFx, showFx.duration || baseDuration, function() {
- $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && showFx.opacity)
- $show[0].style.filter = '';
-
- // callback
+ $show.removeClass(o.hideClass);
+ resetStyle($show, showFx);
self._trigger('show', null, self.ui(clicked, $show[0]));
});
}