Fix to put editable options on the top of the list #2319

This commit is contained in:
Ilia Ross
2024-11-25 15:44:16 +02:00
parent 0178d7ae99
commit 4b87ccb3c1

View File

@@ -28,6 +28,14 @@ if (@{$d->{'data'}}) {
print &ui_columns_start([ "",
$text{'vars_name'},
$text{'vars_value'} ], 100, 0, \@tds);
@{$d->{'data'}} = sort {
# Editing now (highest priority)
($d{$b->[0]} <=> $d{$a->[0]}) ||
# Can edit (second priority)
($canedit{$b->[0]} <=> $canedit{$a->[0]}) ||
# Natural sort for equal priority
$a->[0] cmp $b->[0]
} @{$d->{'data'}};
foreach $v (@{$d->{'data'}}) {
if (!$canedit{$v->[0]}) {
# Cannot edit, so just show value