[Rt-commit] r19921 - rt/3.8/trunk/share/html/Widgets
sartak at bestpractical.com
sartak at bestpractical.com
Fri Jun 5 21:05:25 EDT 2009
Author: sartak
Date: Fri Jun 5 21:05:25 2009
New Revision: 19921
Modified:
rt/3.8/trunk/share/html/Widgets/SelectionBox
Log:
Tidy
Modified: rt/3.8/trunk/share/html/Widgets/SelectionBox
==============================================================================
--- rt/3.8/trunk/share/html/Widgets/SelectionBox (original)
+++ rt/3.8/trunk/share/html/Widgets/SelectionBox Fri Jun 5 21:05:25 2009
@@ -109,42 +109,42 @@
else {
my $current = $self->{Current} = $ARGS{$self->{Name}.'-Current'};
if ($current && !ref ($current)) {
- $current = [$current];
+ $current = [$current];
}
unless ($self->{ReadOnly}) {
++$self->{Modified};
if ($ARGS{add}) {
- my $choosed = $ARGS{$self->{Name}.'-Available'};
- for my $add (ref($choosed) ? @$choosed : $choosed) {
- next if grep { $_ eq $add } @$current;
- push @$current, $add;
- }
+ my $choosed = $ARGS{$self->{Name}.'-Available'};
+ for my $add (ref($choosed) ? @$choosed : $choosed) {
+ next if grep { $_ eq $add } @$current;
+ push @$current, $add;
+ }
}
if ($ARGS{remove}) {
- my $choosed = $ARGS{$self->{Name}.'-Selected'};
- for my $del (ref($choosed) ? @$choosed : $choosed) {
- @$current = map { $_ eq $del ? () : $_ } @$current;
- }
+ my $choosed = $ARGS{$self->{Name}.'-Selected'};
+ for my $del (ref($choosed) ? @$choosed : $choosed) {
+ @$current = map { $_ eq $del ? () : $_ } @$current;
+ }
}
if ($ARGS{moveup} or $ARGS{movedown}) {
- my $offset = $ARGS{moveup} ? 1 : 0;
- my $choosed = $ARGS{$self->{Name}.'-Selected'};
- $choosed = [$choosed] unless ref ($choosed);
- my $canmove = 0; # not in the cornor
- for my $i ($ARGS{moveup} ? 0..$#{$current} : reverse 0..$#{$current}) {
- if (grep {$_ eq $current->[$i]} @$choosed) {
- if ($canmove) {
- splice (@$current, $i-$offset, 2,
- @{$current}[$i+1-$offset,$i-$offset]);
+ my $offset = $ARGS{moveup} ? 1 : 0;
+ my $choosed = $ARGS{$self->{Name}.'-Selected'};
+ $choosed = [$choosed] unless ref ($choosed);
+ my $canmove = 0; # not in the cornor
+ for my $i ($ARGS{moveup} ? 0..$#{$current} : reverse 0..$#{$current}) {
+ if (grep {$_ eq $current->[$i]} @$choosed) {
+ if ($canmove) {
+ splice (@$current, $i-$offset, 2,
+ @{$current}[$i+1-$offset,$i-$offset]);
+ }
+ }
+ else {
+ ++$canmove;
+ }
}
- }
- else {
- ++$canmove;
- }
- }
}
if ($ARGS{clear}) {
More information about the Rt-commit
mailing list