Skip to content

Commit

Permalink
accordion: another partial fix for #4011, fixes tests/visual/accordio…
Browse files Browse the repository at this point in the history
…n/width.html in FF, IE still buggy
  • Loading branch information
jzaefferer committed Jan 31, 2009
1 parent 658a0f7 commit bae4a16
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ui/ui.accordion.js
Expand Up @@ -398,7 +398,14 @@ $.extend($.ui.accordion, {
percentDone,
showProps = {},
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) {
hideProps[prop] = 'hide';

Expand Down Expand Up @@ -431,8 +438,9 @@ $.extend($.ui.accordion, {
easing: options.easing,
complete: function() {
if ( !options.autoHeight ) {
options.toShow.css("height", "auto");
options.toShow.css("height", "");
}
options.toShow.css("width", originalWidth);
options.toShow.css({overflow: overflow});
options.complete();
}
Expand Down

0 comments on commit bae4a16

Please sign in to comment.