From: Bartosz DziewoƄski Date: Mon, 3 Feb 2014 16:49:44 +0000 (+0100) Subject: mediawiki.searchSuggest: Only handle Vector's fulltext hack on Vector X-Git-Tag: 1.31.0-rc.0~17034 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=7940a4b1a2765f082454db8839cf17604edd3d3e;p=lhc%2Fweb%2Fwiklou.git mediawiki.searchSuggest: Only handle Vector's fulltext hack on Vector I'm not sure why I thought what I did would work, obviously it won't. Let's just slap a class on the button. Follow-up to I5fe0543e. Change-Id: I1b3ff802ae0fc0fb9499a07068aefc2590ae3b66 --- diff --git a/resources/mediawiki/mediawiki.searchSuggest.js b/resources/mediawiki/mediawiki.searchSuggest.js index 9fcd42a712..3b360af386 100644 --- a/resources/mediawiki/mediawiki.searchSuggest.js +++ b/resources/mediawiki/mediawiki.searchSuggest.js @@ -164,10 +164,7 @@ // make sure paste and cut events from the mouse and drag&drop events // trigger the keypress handler and cause the suggestions to update $( this ).trigger( 'keypress' ); - } ) - // If the forms include any fulltext search thingies, remove them as they - // would interfere with selecting suggestions - .closest( 'form' ).find( '[name="fulltext"]' ).remove(); + } ); // Ensure that the thing is actually present! if ( $searchRegion.length === 0 ) { @@ -197,6 +194,9 @@ $region: $searchRegion } ); + // If the form includes any fallback fulltext search buttons, remove them + $searchInput.closest( 'form' ).find( '.mw-fallbackSearchButton' ).remove(); + // In most skins (at least Monobook and Vector), the font-size is messed up in . // (they use 2 elements to get a sane font-height). So, instead of making exceptions for // each skin or adding more stylesheets, just copy it from the active element so auto-fit. diff --git a/skins/Vector.php b/skins/Vector.php index adf9003e57..b44b91443f 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -444,7 +444,7 @@ class VectorTemplate extends BaseTemplate { // * The mediawiki.searchSuggest module, after doing tests for the broken browsers, removes // the 'fulltext' button and handles 'fulltext' search itself; this will reveal the 'go' // button and cause it to be used. - echo $this->makeSearchButton( 'fulltext', array( 'id' => 'mw-searchButton', 'class' => 'searchButton' ) ); + echo $this->makeSearchButton( 'fulltext', array( 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' ) ); echo $this->makeSearchButton( 'go', array( 'id' => 'searchButton', 'class' => 'searchButton' ) ); ?>