From 174ec52d6e9fef7e1414b9767562943341832146 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 11 Dec 2008 23:49:35 +0000 Subject: [PATCH] Per code review. Only set focus if we have a search term. --- includes/specials/SpecialSearch.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 5d0f1a7011..bb493cc555 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -619,7 +619,7 @@ class SpecialSearch { if( $t != null && count($this->namespaces) === 1 ) { $out .= wfMsgExt( 'searchmenu-prefix', array('parseinline'), $term ); } - return $this->powerSearchFocus() . + return $term != '' ? $this->powerSearchFocus() : '' . Xml::openElement( 'fieldset', array('id' => 'mw-searchoptions','style' => 'margin:0em;') ) . Xml::element( 'legend', null, wfMsg('powersearch-legend') ) . $this->formHeader($term) . $out . @@ -633,7 +633,7 @@ class SpecialSearch { "document.getElementById('searchText').focus();" . "});" . ""; - } + } protected function powerSearchFocus() { global $wgJsMimeType; @@ -724,7 +724,7 @@ class SpecialSearch { global $wgScript; $searchTitle = SpecialPage::getTitleFor( 'Search' ); $searchable = SearchEngine::searchableNamespaces(); - $out = $this->searchFocus(); + $out = $term != '' ? $this->searchFocus() : ''; $out .= Xml::openElement( 'form', array( 'id' => 'search', 'method' => 'get', 'action' => $wgScript ) ); $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n"; // If searching several, but not all namespaces, show what we are searching. -- 2.20.1