Commit 277e4b1e authored by catch's avatar catch

Issue #1039666 by Jelle_S, droplet, Kevin Morse, nod_: Fixed Placing a block...

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.
parent 042de884
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment