accordion: another partial fix for #4011, fixes tests/visual/accordion/width.html in FF, IE still buggy

This commit is contained in:
Jörn Zaefferer 2009-01-31 16:52:52 +00:00
parent 658a0f7f40
commit bae4a16d61

View File

@ -398,7 +398,14 @@ $.extend($.ui.accordion, {
percentDone, percentDone,
showProps = {}, showProps = {},
hideProps = {}, hideProps = {},
fxAttrs = [ "height", "paddingTop", "paddingBottom" ]; fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
originalWidth;
// fix width before calculating height of hidden element
if (options.toShow[0]) {
var s = options.toShow;
originalWidth = s[0].style.width;
s.width( parseInt(s.parent().width()) - parseInt(s.css("paddingLeft")) - parseInt(s.css("paddingRight")) - parseInt(s.css("borderLeftWidth")) - parseInt(s.css("borderRightWidth")) );
}
$.each(fxAttrs, function(i, prop) { $.each(fxAttrs, function(i, prop) {
hideProps[prop] = 'hide'; hideProps[prop] = 'hide';
@ -431,8 +438,9 @@ $.extend($.ui.accordion, {
easing: options.easing, easing: options.easing,
complete: function() { complete: function() {
if ( !options.autoHeight ) { if ( !options.autoHeight ) {
options.toShow.css("height", "auto"); options.toShow.css("height", "");
} }
options.toShow.css("width", originalWidth);
options.toShow.css({overflow: overflow}); options.toShow.css({overflow: overflow});
options.complete(); options.complete();
} }