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:
Aparup Banerjee
2010-09-10 07:20:41 +00:00
parent cc674674a5
commit 39726f35aa
2 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -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) {
+3
View File
@@ -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)) {