navigation MDL-24129 showing the hidden regions when moving blocks. This also adds the 'blocks-moving' class to the body as an indicator for themers.
This commit is contained in:
+8
-2
@@ -461,14 +461,20 @@ M.core_dock.resizeBlockSpace = function(node) {
|
||||
blockregions[region.get('id')] = {hasblocks: hasblocks, bodyclass: region.get('id').replace(/^region\-/, 'side-')+'-only'};
|
||||
});
|
||||
var bodynode = M.core_dock.nodes.body;
|
||||
var showregions = false;
|
||||
if (bodynode.hasClass('blocks-moving')) {
|
||||
// open up blocks during blocks positioning
|
||||
showregions = true;
|
||||
}
|
||||
|
||||
var noblocksbodyclass = 'content-only';
|
||||
var i = null;
|
||||
if (populatedblockregions==0) {
|
||||
if (populatedblockregions==0 && showregions==false) {
|
||||
bodynode.addClass(noblocksbodyclass);
|
||||
for (i in blockregions) {
|
||||
bodynode.removeClass(blockregions[i].bodyclass);
|
||||
}
|
||||
} else if (populatedblockregions==1) {
|
||||
} else if (populatedblockregions==1 && showregions==false) {
|
||||
bodynode.removeClass(noblocksbodyclass);
|
||||
for (i in blockregions) {
|
||||
if (!blockregions[i].hasblocks) {
|
||||
|
||||
@@ -1368,6 +1368,9 @@ class moodle_page {
|
||||
|
||||
if (!empty($USER->editing)) {
|
||||
$this->add_body_class('editing');
|
||||
if (optional_param('bui_moveid', false, PARAM_INT)) {
|
||||
$this->add_body_class('blocks-moving');
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($CFG->blocksdrag)) {
|
||||
|
||||
Reference in New Issue
Block a user