MDL-35766 AJAX: Conditional activity hiding is separately handled by JS

This commit is contained in:
Rajesh Taneja
2012-10-19 13:43:47 +08:00
parent f4b03cf8e2
commit b53ec9de13
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -1591,6 +1591,11 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if ($accessiblebutdim) {
$linkclasses .= ' dimmed';
$textclasses .= ' dimmed_text';
// If mod is visible and is dimmed because of condition then handle it nicely with JS.
if ($mod->visible) {
$linkclasses .= ' conditionalhidden';
$textclasses .= ' conditionalhidden';
}
$accesstext = '<span class="accesshide">'.
get_string('hiddenfromstudents').': </span>';
} else {
+4 -2
View File
@@ -592,8 +592,10 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj)
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('div')[1], 'dimmed_text')) {
// If dimmed and is not conditional dimmed then hidden.
if ((YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'dimmed') ||
YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('div')[1], 'dimmed_text')) &&
!YAHOO.util.Dom.hasClass(this.getEl().getElementsByTagName('a')[0], 'conditionalhidden')) {
this.hidden = true;
}
this.hiddenStored = null;