From c679952e09a3f6d84f5dbb1b6ebe2bbbfa407e84 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 4 Nov 2008 07:22:23 +0000 Subject: [PATCH] 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. --- lib/javascript-static.js | 11 ++++++----- theme/standard/styles_layout.css | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 30cf3ada05a..fd174eafbf5 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -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. diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 39d0e8f4569..44a02fc14b0 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -219,6 +219,9 @@ div.groupselector { overflow: hidden; padding: 1px; } +.collapsibleregioncaption { + white-space: nowrap; +} .collapsibleregioncaption img { vertical-align: middle; }