summaryrefslogtreecommitdiff
path: root/modules/block
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-30 21:50:41 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-30 21:50:41 -0700
commitf6c660169c90c755bf0868c8e65d45c6113aa164 (patch)
tree16e600b1af1ecc7683cbc84b4e30fc6ad59da775 /modules/block
parent1b8522b91b6e9d3e677692a08ef285c90e073f94 (diff)
downloadbrdo-f6c660169c90c755bf0868c8e65d45c6113aa164.tar.gz
brdo-f6c660169c90c755bf0868c8e65d45c6113aa164.tar.bz2
Issue #1039666 by Jelle_S, droplet, Kevin Morse, nod_: Fixed Placing a block in a region via select dropdown moves it to the top of the region, but it will show at the bottom.
Diffstat (limited to 'modules/block')
-rw-r--r--modules/block/block.js20
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/block/block.js b/modules/block/block.js
index 72b56733a..acd3f5ae2 100644
--- a/modules/block/block.js
+++ b/modules/block/block.js
@@ -117,24 +117,8 @@ Drupal.behaviors.blockDrag = {
var select = $(this);
tableDrag.rowObject = new tableDrag.row(row);
- // Find the correct region and insert the row as the first in the region.
- $('tr.region-message', table).each(function () {
- if ($(this).is('.region-' + select[0].value + '-message')) {
- // Add the new row and remove the old one.
- $(this).after(row);
- // Manually update weights and restripe.
- tableDrag.updateFields(row.get(0));
- tableDrag.rowObject.changed = true;
- if (tableDrag.oldRowElement) {
- $(tableDrag.oldRowElement).removeClass('drag-previous');
- }
- tableDrag.oldRowElement = row.get(0);
- tableDrag.restripeTable();
- tableDrag.rowObject.markChanged();
- tableDrag.oldRowElement = row;
- $(row).addClass('drag-previous');
- }
- });
+ // Find the correct region and insert the row as the last in the region.
+ table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').last().before(row);
// Modify empty regions with added or removed fields.
checkEmptyRegions(table, row);