mediawiki.searchSuggest: Only handle Vector's fulltext hack on Vector
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 3 Feb 2014 16:49:44 +0000 (17:49 +0100)
committerOri.livneh <ori@wikimedia.org>
Tue, 4 Feb 2014 09:34:28 +0000 (09:34 +0000)
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

resources/mediawiki/mediawiki.searchSuggest.js
skins/Vector.php

index 9fcd42a..3b360af 100644 (file)
                                // 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 ) {
                        $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 <body>.
                // (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.
index adf9003..b44b914 100644 (file)
@@ -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' ) );
                        ?>
                </div>