MDL-35766 AJAX: Conditional activity hiding is separately handled by JS
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user