Tweak to r28390:
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 20 Dec 2007 02:40:02 +0000 (02:40 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 20 Dec 2007 02:40:02 +0000 (02:40 +0000)
Instead of disabling the 'Compare selected revisions' button when there's only one revision, just don't show it.
We don't show any radio buttons in this case either, so there's nothing to consider submitting if we wanted to; it's cleaner to just leave it out.

includes/PageHistory.php

index d81e7ff..d2da47a 100644 (file)
@@ -164,16 +164,17 @@ class PageHistory {
         */
        function submitButton( $bits = array() ) {
                # Disable submit button if history has 1 revision only
-               if ( $this->linesonpage == 1 ) {
-                       $bits = $bits + array( 'disabled' => 'disabled' );
-               }
-               return Xml::submitButton( wfMsg( 'compareselectedversions' ),
+               if ( $this->linesonpage > 1 ) {
+                       return Xml::submitButton( wfMsg( 'compareselectedversions' ),
                                $bits + array(
                                        'class'     => 'historysubmit',
                                        'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
                                        'title'     => wfMsg( 'tooltip-compareselectedversions' ),
                                        )
                                );
+               } else {
+                       return '';
+               }
        }
 
        /**