Skip to content

Commit

Permalink
navigation MDL-24129 showing the hidden regions when moving blocks. T…
Browse files Browse the repository at this point in the history
…his also adds the 'blocks-moving' class to the body as an indicator for themers.
  • Loading branch information
nebgor committed Sep 10, 2010
1 parent cc67467 commit 39726f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions blocks/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions lib/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,9 @@ protected function initialise_standard_body_classes() {

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)) {
Expand Down

0 comments on commit 39726f3

Please sign in to comment.