weblib: MDL-17085 a function to print a collapsible region of the UI, with the collapsed state stored in a user_perference - minor layout improvements for IE.

This commit is contained in:
tjhunt 2008-11-04 07:22:23 +00:00
parent 74b4fa56d0
commit c679952e09
2 changed files with 9 additions and 5 deletions

View File

@ -626,7 +626,7 @@ function collapsible_region(id, userpref, strtooltip) {
if (this.div.className.match(/\bcollapsed\b/)) {
this.collapsed = true;
var region = YAHOO.util.Region.getRegion(this.caption);
this.div.style.height = (region.bottom - region.top) + 'px';
this.div.style.height = (region.bottom - region.top + 3) + 'px';
}
// Add the appropriate image.
@ -697,13 +697,14 @@ collapsible_region.prototype.handle_click = function(e) {
this.animation.stop();
}
if (this.collapsed) {
var targetel = this.caption;
var region = YAHOO.util.Region.getRegion(this.caption);
var targetheight = region.bottom - region.top + 3;
} else {
var targetel = this.innerdiv;
var region = YAHOO.util.Region.getRegion(this.innerdiv);
var targetheight = region.bottom - region.top + 2;
this.div.className = this.div.className.replace(/\s*\bcollapsed\b\s*/, ' ');
}
var region = YAHOO.util.Region.getRegion(targetel);
this.animation.attributes.height = { to: region.bottom - region.top, unit: 'px' };
this.animation.attributes.height = { to: targetheight, unit: 'px' };
this.animation.animate();
// Set the appropriate icon.

View File

@ -219,6 +219,9 @@ div.groupselector {
overflow: hidden;
padding: 1px;
}
.collapsibleregioncaption {
white-space: nowrap;
}
.collapsibleregioncaption img {
vertical-align: middle;
}