From: Bartosz DziewoƄski Date: Tue, 13 May 2014 22:31:02 +0000 (+0200) Subject: mediawiki.searchSuggest: Adjust font size for all inputs, not just magic ones X-Git-Tag: 1.31.0-rc.0~15683 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=bbf901378162b8d961b720edd44e12473f17774c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) );