Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r20868: LJSUP-10863: Display only one folded par...

Committer: anazarov
LJSUP-10863: Display only one folded parent at thread - s1
U   trunk/cgi-bin/LJ/Talk.pm
Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2011-12-28 09:38:57 UTC (rev 20867)
+++ trunk/cgi-bin/LJ/Talk.pm	2011-12-28 11:48:51 UTC (rev 20868)
@@ -1553,13 +1553,15 @@
     }
     
     my $thread = $opts->{'thread'}+0;
-    if ($thread && $opts->{show_parents}) {
+    my $show_parents = int $opts->{'show_parents'};
+    if ($thread && $show_parents) {
         while (my $parent_thread = $posts->{$thread}->{'parenttalkid'}) {
             $children->{$parent_thread} = [ $thread ];
             $posts->{$parent_thread}->{'children'} = [ $posts->{$thread} ];
             $posts->{$parent_thread}->{'_collapsed'} = 1;
             $posts_to_load{$parent_thread} = 1;
             $thread = $parent_thread;
+            --$show_parents or last;
         }
         $top_replies = [ $thread ];
     }

Tags: anazarov, livejournal, nfokz, pm
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