mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
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:
parent
74b4fa56d0
commit
c679952e09
@ -626,7 +626,7 @@ function collapsible_region(id, userpref, strtooltip) {
|
|||||||
if (this.div.className.match(/\bcollapsed\b/)) {
|
if (this.div.className.match(/\bcollapsed\b/)) {
|
||||||
this.collapsed = true;
|
this.collapsed = true;
|
||||||
var region = YAHOO.util.Region.getRegion(this.caption);
|
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.
|
// Add the appropriate image.
|
||||||
@ -697,13 +697,14 @@ collapsible_region.prototype.handle_click = function(e) {
|
|||||||
this.animation.stop();
|
this.animation.stop();
|
||||||
}
|
}
|
||||||
if (this.collapsed) {
|
if (this.collapsed) {
|
||||||
var targetel = this.caption;
|
var region = YAHOO.util.Region.getRegion(this.caption);
|
||||||
|
var targetheight = region.bottom - region.top + 3;
|
||||||
} else {
|
} 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*/, ' ');
|
this.div.className = this.div.className.replace(/\s*\bcollapsed\b\s*/, ' ');
|
||||||
}
|
}
|
||||||
var region = YAHOO.util.Region.getRegion(targetel);
|
this.animation.attributes.height = { to: targetheight, unit: 'px' };
|
||||||
this.animation.attributes.height = { to: region.bottom - region.top, unit: 'px' };
|
|
||||||
this.animation.animate();
|
this.animation.animate();
|
||||||
|
|
||||||
// Set the appropriate icon.
|
// Set the appropriate icon.
|
||||||
|
@ -219,6 +219,9 @@ div.groupselector {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
|
.collapsibleregioncaption {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.collapsibleregioncaption img {
|
.collapsibleregioncaption img {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user