summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-04-24 01:51:14 (GMT)
committercatch2012-04-24 01:51:14 (GMT)
commit277e4b1e47ff8dd5f75dc89319a369204f8429a1 (patch)
tree22e77f2807a607946eb8f561cef050a4ef7e22b3
parent042de88417748a10c6107179ac60d5f8393db980 (diff)
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.
-rw-r--r--core/modules/block/block.js20
1 files changed, 2 insertions, 18 deletions
diff --git a/core/modules/block/block.js b/core/modules/block/block.js
index 097b9a7..dabb570 100644
--- a/core/modules/block/block.js
+++ b/core/modules/block/block.js
@@ -131,24 +131,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.
- table.find('tr.region-message').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);