Opened 14 years ago

Closed 14 years ago

resize function with autoheight

Reported by: Owned by: guile minor 1.8 ui.accordion 1.7.1

Description

based on version 1.7.1.

There is a problem with the resize function for autoHeight when it sets the new height based on the maxHeight. MaxHeight is calculated based on the outerHeight which is normal but then it sets the height of each element based on maxHeight. It should set the height of the element based on maxHeight -(border and padding of this resized element). Below is my bugfix proposition. I tested it and it works.

Current code from line 191:

} else if ( o.autoHeight ) {

maxHeight = Math.max(maxHeight, \$(this).outerHeight());

}).height(maxHeight);

}

My solution: from line 191

} else if ( o.autoHeight ) {

maxHeight = Math.max(maxHeight, \$(this).outerHeight());

}).height(function(){

return maxHeight-\$(this).outerHeight()+\$(this).height()

});

}

comment:1 Changed 14 years ago by guile

Sorry but I made a mistake.

This is a better code

} else if ( o.autoHeight ) {

maxHeight = Math.max(maxHeight, \$(this).outerHeight());

}).each(function() {

var newHeight=maxHeight-\$(this).outerHeight()+\$(this).height();
(this).height(newHeight);

});

}

comment:2 Changed 14 years ago by guile

OK sorry again the mistakes above. Here it looks a lot better.

This is what I suggest from line 191:

```} else if ( o.autoHeight ) {
maxHeight = 0;
maxHeight = Math.max(maxHeight, \$(this).outerHeight());
}).each(function() {
var newHeight=maxHeight-\$(this).outerHeight()+\$(this).height();
\$(this).height(newHeight);
});
}
```

comment:3 Changed 14 years ago by Scott González

Milestone: TBD → 1.8

comment:4 Changed 14 years ago by Jörn Zaefferer

Resolution: → fixed new → closed

Fixed in r3038. The change is to just use height() instead of outerHeight(), making it much simpler then what you proposed.

Please reopen this ticket if that isn't enough for you, preferably with a usecase included.

Note: See TracTickets for help on using tickets.