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

[livejournal] r21146: LJSUP-10910: View comments in My Style s...

Committer: anazarov
LJSUP-10910: View comments in My Style setting
U   trunk/cgi-bin/LJ/Setting/CommentsStyleMine.pm
Modified: trunk/cgi-bin/LJ/Setting/CommentsStyleMine.pm
===================================================================
--- trunk/cgi-bin/LJ/Setting/CommentsStyleMine.pm	2012-02-09 07:32:10 UTC (rev 21145)
+++ trunk/cgi-bin/LJ/Setting/CommentsStyleMine.pm	2012-02-09 07:59:24 UTC (rev 21146)
@@ -10,7 +10,25 @@
     return 0 unless $u;
     return 0 unless LJ::is_enabled('comments_style_mine');
     return 0 unless $u->is_personal;
+    return 1;
+}
 
+sub label {
+    my $class = shift;
+
+    return $class->ml('setting.commentsstylemine.label');
+}
+
+sub option {
+    my ($class, $u, $errs, $args) = @_;
+    my $key = $class->pkgkey;
+
+    my $stylealwaysmine = $class->get_arg($args, "stylealwaysmine") || $u->opt_stylealwaysmine;
+    my $commentsstylemine = $class->get_arg($args, "commentsstylemine") || $u->opt_commentsstylemine;
+    my $can_use_commentsstylemine = $u->can_use_commentsstylemine? 1 : 0;
+
+    $can_use_commentsstylemine = 0 if $stylealwaysmine;
+
     my $get_styleinfo = sub {
         my $journal = shift;
 
@@ -38,31 +56,12 @@
                        LJ::get_cap($u, "s2viewentry");
     }
 
-    return $use_s1? 1 : 0;
-}
-
-sub label {
-    my $class = shift;
-
-    return $class->ml('setting.commentsstylemine.label');
-}
-
-sub option {
-    my ($class, $u, $errs, $args) = @_;
-    my $key = $class->pkgkey;
-
-    my $stylealwaysmine = $class->get_arg($args, "stylealwaysmine") || $u->opt_stylealwaysmine;
-    my $commentsstylemine = $class->get_arg($args, "commentsstylemine") || $u->opt_commentsstylemine;
-    my $can_use_commentsstylemine = $u->can_use_commentsstylemine? 1 : 0;
-
-    $can_use_commentsstylemine = 0 if $stylealwaysmine;
-
     my $ret = LJ::html_check({
         name => "${key}commentsstylemine",
         id => "${key}commentsstylemine",
         value => 1,
-        selected => $commentsstylemine && $can_use_commentsstylemine? 1 : 0,
-        disabled => $can_use_commentsstylemine? 0 : 1,
+        selected => $commentsstylemine && $can_use_commentsstylemine && $use_s1? 1 : 0,
+        disabled => $can_use_commentsstylemine && $use_s1? 0 : 1,
     });
 
     $ret .= " <label for='${key}commentsstylemine'>" . $class->ml('setting.commentsstylemine.option') . "</label>";

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