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

Drag n Drop does not work when moving blocks into custom regions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.3.2
    • Administration
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-33890-master-2
    • Hide

      Switch Javascript off in the browser and move them the old way.

      Show
      Switch Javascript off in the browser and move them the old way.
    • Hide
      1. Install Aardvark Post-IT theme with the patch
      2. Move block to new block region at the top
      3. Move block from the new region (it becomes empty) - make sure that side block regions are not getting hidden at this point.

      Also, testing existing functionality is required:

      1. Move all blocks from left or right region that does not contain block adding block.
      2. On the last block move, the region should be hidden.
      3. Move any block towards the hidden region, the region should be displayed and accept new block.
      Show
      Install Aardvark Post-IT theme with the patch Move block to new block region at the top Move block from the new region (it becomes empty) - make sure that side block regions are not getting hidden at this point. Also, testing existing functionality is required: Move all blocks from left or right region that does not contain block adding block. On the last block move, the region should be hidden. Move any block towards the hidden region, the region should be displayed and accept new block.

    Description

      In contributed themes like Aardvark Post-IT and Aerie which have custom block-regions set in the layout, the new AJAX Drag n Drop feature does not allow you to move blocks into these designated areas.

      On further inspection of this problem, it has come to light that the main 'block-regions' like 'region-pre' snd 'region-post' have been hard coded in lib/yui/blocks/blocks.js

       var regionid = this.get_region_id(blockregionlist.item(0));
                      if (regionid === 'post') {
                          // pre block is missing, instert it before post
                          blockregion.setAttrs({id : 'region-pre'});
                          blockregionlist.item(0).insert(blockregion, 'before');
                          blockregionlist.unshift(blockregion);
                      } else {
                          // post block is missing, instert it after pre
                          blockregion.setAttrs({id : 'region-post'});
                          blockregionlist.item(0).insert(blockregion, 'after');
                          blockregionlist.push(blockregion);
                      }

      Attachments

        Issue Links

          Activity

            People

              kabalin Ruslan Kabalin
              lazydaisy Mary Evans
              Dan Poltawski Dan Poltawski
              Jason Fowler Jason Fowler
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              7 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Sep/12