Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/288764

Change subject: SpecialSearch: Use OOUI\FieldLayout for search input and button
......................................................................

SpecialSearch: Use OOUI\FieldLayout for search input and button

This prevents the button from flipping to a new line if the window or
the available width at all is smaller as the width of the input and the
button together. Now, the input will be as small as needed for the button
to be on the same line.

Bug: T134475
Change-Id: Icc68a8e83fc7037b96a5efec2766ffdf453c5413
---
M includes/specials/SpecialSearch.php
M resources/src/mediawiki.special/mediawiki.special.search.css
2 files changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/288764/1

diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index d474ba5..eb6b77f 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -1240,17 +1240,21 @@
                        'value' => $term,
                        'dataLocation' => 'content',
                ] );
+               $layout = new OOUI\FieldLayout( $searchWidget );
+               $layout->addClasses( [ 'mw-search-fieldLayout' ] );
+               $layout->appendContent(
+                       new OOUI\ButtonInputWidget( [
+                               'type' => 'submit',
+                               'label' => $this->msg( 'searchbutton' )->text(),
+                               'flags' => [ 'progressive', 'primary' ],
+                       ] )
+               );
 
                $out =
                        Html::hidden( 'title', 
$this->getPageTitle()->getPrefixedText() ) .
                        Html::hidden( 'profile', $this->profile ) .
                        Html::hidden( 'fulltext', 'Search' ) .
-                       $searchWidget .
-                       new OOUI\ButtonInputWidget( [
-                               'type' => 'submit',
-                               'label' => $this->msg( 'searchbutton' )->text(),
-                               'flags' => [ 'progressive', 'primary' ],
-                       ] );
+                       $layout;
 
                // Results-info
                if ( $totalNum > 0 && $this->offset < $totalNum ) {
diff --git a/resources/src/mediawiki.special/mediawiki.special.search.css 
b/resources/src/mediawiki.special/mediawiki.special.search.css
index 1ce9569..c17c914 100755
--- a/resources/src/mediawiki.special/mediawiki.special.search.css
+++ b/resources/src/mediawiki.special/mediawiki.special.search.css
@@ -169,6 +169,13 @@
 .searchmatch {
        font-weight: bold;
 }
+.mw-search-fieldLayout {
+       display: inline-block;
+       width: 70%;
+}
+.oo-ui-fieldLayout-field {
+       margin-right: 0.5em;
+}
 /* Advanced PowerSearch box */
 td#mw-search-togglebox {
        text-align: right;

-- 
To view, visit https://gerrit.wikimedia.org/r/288764
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc68a8e83fc7037b96a5efec2766ffdf453c5413
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to