Permalink
Browse files

Merge branch 'wip-mdl-35766-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
danpoltawski committed Nov 5, 2012
2 parents 5a83ba3 + b53ec9d commit 9cbc51937a14a0ae5af507f6b0e794ffdcbd3e3f
Showing with 9 additions and 2 deletions.
  1. +5 −0 course/lib.php
  2. +4 −2 lib/ajax/section_classes.js
View
@@ -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;

0 comments on commit 9cbc519

Please sign in to comment.