diff --git a/core/modules/block/js/block.js b/core/modules/block/js/block.js index e836e81..83ae1b7 100644 --- a/core/modules/block/js/block.js +++ b/core/modules/block/js/block.js @@ -63,13 +63,13 @@ return; } - var table = $('#blocks'); + var $table = $('#blocks'); // Get the blocks tableDrag object. var tableDrag = Drupal.tableDrag.blocks; // Add a handler for when a row is swapped, update empty regions. tableDrag.row.prototype.onSwap = function (swappedRow) { - checkEmptyRegions(table, this); - updateLastPlaced(table, this); + checkEmptyRegions($table, this); + updateLastPlaced($table, this); }; // Add a handler so when a row is dropped, update fields dropped into new regions. @@ -99,7 +99,7 @@ regionField.val(regionName); } - updateBlockWeights(table, regionName); + updateBlockWeights($table, regionName); }; // Add the behavior to each region select list. @@ -110,13 +110,13 @@ var select = $(this); // Find the correct region and insert the row as the last in the region. - table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').eq(-1).before(row); + $table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').eq(-1).before(row); - updateBlockWeights(table, select[0].value); + updateBlockWeights($table, select[0].value); // Modify empty regions with added or removed fields. - checkEmptyRegions(table, row); + checkEmptyRegions($table, row); // Update last placed block indication. - updateLastPlaced(table, row); + updateLastPlaced($table, row); // Show unsaved changes warning. if (!tableDrag.changed) { $(Drupal.theme('tableDragChangedWarning')).insertBefore(tableDrag.table).hide().fadeIn('slow'); @@ -126,16 +126,16 @@ select.trigger('blur'); }); - var updateLastPlaced = function (table, rowObject) { + var updateLastPlaced = function ($table, rowObject) { // Remove the color-success class from new block if applicable. - table.find('.color-success').removeClass('color-success'); + $table.find('.color-success').removeClass('color-success'); var $rowObject = $(rowObject); if (!$rowObject.is('.drag-previous')) { - table.find('.drag-previous').removeClass('drag-previous'); + $table.find('.drag-previous').removeClass('drag-previous'); $rowObject.addClass('drag-previous'); } - } + }; /** * Update block weights in the given region. @@ -159,8 +159,8 @@ }); }; - var checkEmptyRegions = function (table, rowObject) { - table.find('tr.region-message').each(function () { + var checkEmptyRegions = function ($table, rowObject) { + $table.find('tr.region-message').each(function () { var $this = $(this); // If the dragged row is in this region, but above the message row, swap it down one space. if ($this.prev('tr').get(0) === rowObject.element) {