-
Improvement
-
Resolution: Fixed
-
Minor
-
2.9
-
MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
MDL-49094-master -
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%;
|
}
|
- caused a regression
-
MDL-50923 Frontpage layout is missing bodyclass 'content-only' when blocks are hidden
-
- Closed
-