Merge "Override default source mode font in placeholders too"

This commit is contained in:
jenkins-bot 2021-09-14 21:21:47 +00:00 committed by Gerrit Code Review
commit 51eb60a81e
2 changed files with 9 additions and 13 deletions

View file

@ -5,11 +5,6 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
.ve-ui-mwWikitextSurface .ve-ce-attachedRootNode {
/* Inherit mw-editfont setting instead of default source mode setting */
font-family: inherit;
}
.ve-ui-mwWikitextSurface .ve-ce-paragraphNode {
line-height: 1.5em;
}

View file

@ -20,16 +20,17 @@ ve.ui.MWWikitextSurface = function VeUiMWWikitextSurface() {
// Initialization
this.$element.addClass( 've-ui-mwWikitextSurface' );
// The following classes are used here:
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
this.getView().$element.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );
// eslint-disable-next-line mediawiki/class-doc
this.$placeholder.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );
this.getView().$element.add( this.$placeholder )
.removeClass( 've-ui-surface-source-font' )
// The following classes are used here:
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );
// eslint-disable-next-line no-jquery/no-global-selector
this.$textbox = $( '#wpTextbox1' );
if ( !this.$textbox.length ) {
this.$textbox = $( '<textarea>' )
.attr( 'id', 'wpTextbox1' )