Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29742

Extra class added when item hidden with Ajax enabled

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.3
    • Component/s: JavaScript, Themes
    • Labels:
    • Testing Instructions:
      Hide

      If you include the css below in a theme. You can see that the area surrounding a resource goes grey when it is hidden. If you reload the page whilst some resources are hidden the area will not be grey until you have toggled them visible and then hidden again

      .region-content .dimmed_text {
      background: none repeat scroll 0 0 #EDEDED;
      }

      Show
      If you include the css below in a theme. You can see that the area surrounding a resource goes grey when it is hidden. If you reload the page whilst some resources are hidden the area will not be grey until you have toggled them visible and then hidden again .region-content .dimmed_text { background: none repeat scroll 0 0 #EDEDED; }
    • Workaround:
      Hide

      In /course/lib.php function print_section

      just before

      echo html_writer::start_tag('div', array('class'=>join(' ', $classes)));

      place

      if ($accessiblebutdim){$classes[] = 'dimmed_text';}

      Show
      In /course/lib.php function print_section just before echo html_writer::start_tag('div', array('class'=>join(' ', $classes))); place if ($accessiblebutdim){$classes[] = 'dimmed_text';}
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE

      Description

      When Ajax is enabled and a resource is hidden the class dimmed_text is appended to the div surrounding a resource. This is not set when Ajax disabled or on the initial page loading.

      As it can be styled it would be useful to have it available from page load

      e.g.
      .region-content .dimmed_text {
      background: none repeat scroll 0 0 #EDEDED;
      }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              brummie1 Matthew Cannings added a comment -

              Just checked on 2.3dev and it no longer inserts the dimmed_text class in the div surrounding the element but rather on the link to the resource itself.

              This CSS hack/problem is no longer relevant

              Show
              brummie1 Matthew Cannings added a comment - Just checked on 2.3dev and it no longer inserts the dimmed_text class in the div surrounding the element but rather on the link to the resource itself. This CSS hack/problem is no longer relevant
              Hide
              lazydaisy Mary Evans added a comment -

              Does this mean we can close this?

              Show
              lazydaisy Mary Evans added a comment - Does this mean we can close this?
              Hide
              brummie1 Matthew Cannings added a comment - - edited

              I guess so as a fix would not have any affect on 2.3 as it is at the moment and people could hack this into <2.2 if they wanted it. I was going to close it but not able to.

              Show
              brummie1 Matthew Cannings added a comment - - edited I guess so as a fix would not have any affect on 2.3 as it is at the moment and people could hack this into <2.2 if they wanted it. I was going to close it but not able to.
              Hide
              poltawski Dan Poltawski added a comment -

              Thanks for clarifying, closing.

              Show
              poltawski Dan Poltawski added a comment - Thanks for clarifying, closing.

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12