Details
Description
The hide/show eye icon on labels always shows as open if AJAX is enabled.
To reproduce:
Make sure AJAX is enabled.
Turn editing on.
Create a label.
Hide the label by clicking the eye icon, or by going to the update label screen and setting the visible property to hide.
Navigate back to the course page (or refresh it) - the eye is now open again.
Note that the label is actually hidden from students - it is just that the eye icon is incorrect, leading teachers to believe that the label is not hidden when it really is.
Other resources are links, with 'class="dimmed"' if they are hidden. Labels are spans, with 'class="dimmed_text"' if they are hidden. The AJAX code only checks links when determining whether or not the eye icon should be closed. It needs to check for dimmed_text spans as well. Here's a patch for 1.8+ and 1.9 -
RCS file: /cvsroot/moodle/moodle/lib/ajax/section_classes.js,v
retrieving revision 1.32.2.2
diff -c -r1.32.2.2 section_classes.js
***************
this.id = this.getEl().id.replace(/module-/i, '');
this.hidden = false;
! if (YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'dimmed')) { this.hidden = true; }
this.hiddenStored = null;
— 516,522 ----
this.id = this.getEl().id.replace(/module-/i, '');
this.hidden = false;
! if (YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'dimmed') || YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('span')[0], 'dimmed_text')) { this.hidden = true; } }
this.hiddenStored = null;
-
-
- section_classes.js 27 Aug 2007 17:27:00 -0000 1.32.2.2
- section_classes.js 6 Nov 2007 14:21:19 -0000
***************
- 516,522 ****
this.id = this.getEl().id.replace(/module-/i, '');
this.hidden = false; ! if (YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'dimmed')) { this.hidden = true; } this.hiddenStored = null; — 516,522 ---- this.id = this.getEl().id.replace(/module-/i, ''); this.hidden = false; ! if (YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'dimmed') || YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('span')[0], 'dimmed_text')) { this.hidden = true; } } this.hiddenStored = null;