From b39fe6dbb7dcb2f4bc55cd66e63f273baff075ee Mon Sep 17 00:00:00 2001
From: Nathaniel <catch@35733.no-reply.drupal.org>
Date: Thu, 1 Dec 2011 17:02:58 +0900
Subject: [PATCH] Issue #1039666 by mlncn: 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.

---
 core/modules/block/block.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/block/block.js b/core/modules/block/block.js
index ce4995dcadf7..64555999c530 100644
--- a/core/modules/block/block.js
+++ b/core/modules/block/block.js
@@ -117,11 +117,11 @@ 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.
+        // Find the correct region and insert the row as the last 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);
+            $(this).nextUntil('.region-title').last().after(row);
             // Manually update weights and restripe.
             tableDrag.updateFields(row.get(0));
             tableDrag.rowObject.changed = true;
-- 
GitLab