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

Block Region issue in My Home

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      Run attached behat test

      Note: I did not feel it necessary to add the behat test to the branch as it is such a specific test that I do not feel that it makes sense to be run on such a regular basis.

      Show
      Run attached behat test Note: I did not feel it necessary to add the behat test to the branch as it is such a specific test that I do not feel that it makes sense to be run on such a regular basis.
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull Master Branch:
      MDL-49094-master

      Description

      In trying to track down why the body class 'content-only' only appears in some situations and not others, I discovered it was set using JavaScript.
      This is making lots of work all round, thus calling for yet more overqualified CSS mark-up of 7 or 8 bodyclasses selectors in themes just to make a page layout display correctly, when .content-only would do just as well!

      For example, when all side blocks are docked in the My Home page (mydashboard) the blocks in the centre of the page are classed as a block region, yet not given the body class of 'content-only' in yui/src/dock/js/dock.js and other similar scripts elsewhere (I cannot quite fathom which is which).

      Looking at the dock.js it looks as though a condition could be set up that sets the content-only when All side blocks are docked whilst some blocks are in the center content region.

              if (BODY.hasClass('blocks-moving')) {
                  // open up blocks during blocks positioning
                  showregions = true;
              }
              if (populatedblockregions === 0 && showregions === false) {
                  BODY.addClass(CSS.contentonly);
              } else {
                  BODY.removeClass(CSS.contentonly);
              }
      

      Here is the CSS
      =============

      .jsenabled.has-region-content.used-region-content.docked-region-side-pre.docked-region-side-post #region-main-box,
      .jsenabled.has-region-content.used-region-content.docked-region-side-pre.docked-region-side-post #region-main {
        width: 100%;
      }
       
      .content-only #region-main-box,
      .content-only #region-main {
        width: 100%;
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Lyons
              Reporter:
              lazydaisy Mary Evans
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15