From 3070b55c513bd2478b56d4fb81274fdfc4159be1 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 27 May 2016 16:02:40 +0200 Subject: [PATCH] SpecialSearch: Use OOUI\ActionFieldLayout 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 --- includes/specials/SpecialSearch.php | 15 +++++++++------ .../mediawiki.special.search.styles.css | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e14fcf5b03..b98ddda1af 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -1241,16 +1241,19 @@ class SpecialSearch extends SpecialPage { 'dataLocation' => 'content', ] ); + $layout = new OOUI\ActionFieldLayout( $searchWidget, new OOUI\ButtonInputWidget( [ + 'type' => 'submit', + 'label' => $this->msg( 'searchbutton' )->text(), + 'flags' => [ 'progressive', 'primary' ], + ] ), [ + 'align' => 'top', + ] ); + $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.styles.css b/resources/src/mediawiki.special/mediawiki.special.search.styles.css index 7be7c84ad4..e8fda84535 100644 --- a/resources/src/mediawiki.special/mediawiki.special.search.styles.css +++ b/resources/src/mediawiki.special/mediawiki.special.search.styles.css @@ -84,7 +84,6 @@ div.searchresult { color: #666; font-size: 95%; } - fieldset#mw-searchoptions { margin: 0; padding: 0.5em 0.75em 0.75em 0.75em; -- 2.20.1