Первый фоллен на хелле (wildkin) wrote in changelog,
Первый фоллен на хелле
wildkin
changelog

[livejournal] r19053: LJSUP-8812: Highlight current filter of ...

Committer: dnikolaev
LJSUP-8812: Highlight current filter of viewing friendspage

U   trunk/cgi-bin/LJ/ControlStrip.pm
Modified: trunk/cgi-bin/LJ/ControlStrip.pm
===================================================================
--- trunk/cgi-bin/LJ/ControlStrip.pm	2011-05-12 09:04:41 UTC (rev 19052)
+++ trunk/cgi-bin/LJ/ControlStrip.pm	2011-05-12 09:23:16 UTC (rev 19053)
@@ -194,20 +194,24 @@
                     }
                 }
 
+                my $selected_group = undef;
+                if (LJ::Request->uri eq "/friends" && LJ::Request->args ne "") {
+                    my %GET = LJ::Request->args;
+                    $data_journal->{view_friends_show} = uc(substr($GET{show}, 0, 1)) if $GET{show};
+                } elsif (LJ::Request->uri =~ /^\/friends\/([^\/]+)/i) {
+                    $selected_group = LJ::durl($1);
+                    $data_journal->{view_friends_group} = $selected_group;
+                }
+
                 foreach my $g (sort { $group{$a}->{'sortorder'} <=> $group{$b}->{'sortorder'} } keys %group) {
                     push @filters, "filter:" . lc($group{$g}->{'name'}), $group{$g}->{'name'};
-                    push @{$data_remote->{friend_groups}}, {
+                    my $item = {
                         name  => lc($group{$g}->{name}),
                         value => $group{$g}->{name},
                     };
+                    $item->{selected} = 1 if $item->{name} eq lc($selected_group);
+                    push @{$data_remote->{friend_groups}}, $item;
                 }
-
-                if (LJ::Request->uri eq "/friends" && LJ::Request->args ne "") {
-                    my %GET = LJ::Request->args;
-                    $data_journal->{view_friends_show} = uc(substr($GET{show}, 0, 1)) if $GET{show};
-                } elsif (LJ::Request->uri =~ /^\/friends\/([^\/]+)/i) {
-                    $data_journal->{view_friends_group} = LJ::durl($1);
-                }
             }
         }
         elsif ($data_journal->{is_personal})

Tags: livejournal, pm, wildkin
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments