Skip to content

Commit

Permalink
course ajax MDL-22653 Toggling of label visibility now dims text corr…
Browse files Browse the repository at this point in the history
…ectly. Kudos to Davo
  • Loading branch information
Sam Hemelryk committed Jun 3, 2010
1 parent 704c5df commit 56dc41d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ajax/section_classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj)
this.groupmode = null; // Can be null (i.e. does not apply), 0, 1 or 2.

this.linkContainer = this.getEl().getElementsByTagName('a')[0];
this.divContainer = this.getEl().getElementsByTagName('div')[0];

this.commandContainer = null;
this.indentLeftButton = null;
Expand Down Expand Up @@ -757,6 +758,7 @@ resource_class.prototype.toggle_hide = function(target, e, superficial, force) {
}
if (this.hidden) {
YAHOO.util.Dom.removeClass(this.linkContainer, 'dimmed');
YAHOO.util.Dom.removeClass(this.divContainer, 'dimmed_text');
this.viewButton.childNodes[0].src = this.viewButton.childNodes[0].src.replace(/show/i, 'hide');
this.viewButton.childNodes[0].alt = this.viewButton.childNodes[0].alt.replace(strshow, strhide);
this.viewButton.title = this.viewButton.title.replace(strshow, strhide);
Expand All @@ -767,6 +769,7 @@ resource_class.prototype.toggle_hide = function(target, e, superficial, force) {
}
} else {
YAHOO.util.Dom.addClass(this.linkContainer, 'dimmed');
YAHOO.util.Dom.addClass(this.divContainer, 'dimmed_text');
this.viewButton.childNodes[0].src = this.viewButton.childNodes[0].src.replace(/hide/i, 'show');
this.viewButton.childNodes[0].alt = this.viewButton.childNodes[0].alt.replace(strhide, strshow);
this.viewButton.title = this.viewButton.title.replace(strhide, strshow);
Expand Down

0 comments on commit 56dc41d

Please sign in to comment.