Skip to content
Snippets Groups Projects
Commit cde3375b authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #1016056 by nod_: added Hide tabledrag handle and 'Show row weights'...

- Patch #1016056 by nod_: added Hide tabledrag handle and 'Show row weights' when there is only one item in list.
parent 9b29a0da
Branches
Tags 1.1.3
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -84,7 +84,10 @@ Drupal.tableDrag = function (table, tableSettings) {
// Make each applicable row draggable.
// Match immediate children of the parent element to allow nesting.
$table.find('> tr.draggable, > tbody > tr.draggable').each(function () { self.makeDraggable(this); });
var $rows = $table.find('> tr.draggable, > tbody > tr.draggable');
if ($rows.length > 1) {
$rows.each(function () { self.makeDraggable(this); });
}
// Add a link before the table for users to show or hide weight columns.
$table.before($('<a href="#" class="tabledrag-toggle-weight"></a>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment