From bbf901378162b8d961b720edd44e12473f17774c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 14 May 2014 00:31:02 +0200 Subject: [PATCH] mediawiki.searchSuggest: Adjust font size for all inputs, not just magic ones I have no idea why the fix was limited, this issue affects every single input on every single page (including ones that are part of MediaWiki interface itself, not skins, see If4ae687b). Change-Id: I7a6dfbcced64dbfce5d1ab31201c98a134f72fe9 --- .../src/mediawiki/mediawiki.searchSuggest.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js b/resources/src/mediawiki/mediawiki.searchSuggest.js index ea7c0c5831..cbdf66600e 100644 --- a/resources/src/mediawiki/mediawiki.searchSuggest.js +++ b/resources/src/mediawiki/mediawiki.searchSuggest.js @@ -115,6 +115,7 @@ '#powerSearchText', '#searchText', // Generic selector for skins with multiple searchboxes (used by CologneBlue) + // and for MediaWiki itself (special pages with page title inputs) '.mw-searchInput' ]; $( searchboxesSelectors.join( ', ' ) ) @@ -156,6 +157,16 @@ // 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' ); + } ) + // 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. + .each( function () { + var $this = $( this ); + $this + .data( 'suggestions-context' ) + .data.$container + .css( 'fontSize', $this.css( 'fontSize' ) ); } ); // Ensure that the thing is actually present! @@ -181,15 +192,6 @@ // 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. - $searchInput - .data( 'suggestions-context' ) - .data.$container - .css( 'fontSize', $searchInput.css( 'fontSize' ) ); - } ); }( mediaWiki, jQuery ) ); -- 2.20.1