SpecialWatchlist: Keep checkboxes and their labels together
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 19 Nov 2015 20:31:16 +0000 (21:31 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 19 Nov 2015 20:38:22 +0000 (21:38 +0100)
Style added to shared.css, since I intend to reuse it elsewhere.
We have a lot of inline style="white-space: nowrap;" in some places.

Bug: T119055
Change-Id: If6cfcaac070cd51a93c078248b65020ae81d94f2

includes/specials/SpecialWatchlist.php
resources/src/mediawiki.legacy/shared.css

index 52ff4cd..2feaa9e 100644 (file)
@@ -480,21 +480,21 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                                'id' => 'namespace',
                                'class' => 'namespaceselector',
                        )
-               ) . '&#160;';
-               $form .= Xml::checkLabel(
+               ) . "\n";
+               $form .= '<span class="mw-input-with-label">' . Xml::checkLabel(
                        $this->msg( 'invert' )->text(),
                        'invert',
                        'nsinvert',
                        $opts['invert'],
                        array( 'title' => $this->msg( 'tooltip-invert' )->text() )
-               ) . '&#160;';
-               $form .= Xml::checkLabel(
+               ) . "</span>\n";
+               $form .= '<span class="mw-input-with-label">' . Xml::checkLabel(
                        $this->msg( 'namespace_association' )->text(),
                        'associated',
                        'nsassociated',
                        $opts['associated'],
                        array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
-               ) . '&#160;';
+               ) . "</span>\n";
                $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "</p>\n";
                foreach ( $hiddenFields as $key => $value ) {
                        $form .= Html::hidden( $key, $value ) . "\n";
@@ -598,12 +598,12 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        protected function showHideCheck( $options, $message, $name, $value ) {
                $options[$name] = 1 - (int)$value;
 
-               return Xml::checkLabel(
+               return '<span class="mw-input-with-label">' . Xml::checkLabel(
                        $this->msg( $message, '' )->text(),
                        $name,
                        $name,
                        (int)$value
-               );
+               ) . '</span>';
        }
 
        /**
index 07d9780..75a091c 100644 (file)
@@ -191,6 +191,10 @@ input#wpSummary {
        margin-bottom: 1em;
 }
 
+.mw-input-with-label {
+       white-space: nowrap;
+}
+
 /**
  * Image captions.
  *