MWLatexDialog: Fix hard-coded line height

This changed after the OOUI font-size change. Also reduce
the preview height which is measure in em's so that it is
closer to its original pixel value.

Also fix line height for error messages.

Change-Id: I3537d33dc1889e0154f4574bb33b22b3c006fe9c
This commit is contained in:
James D. Forrester 2018-06-07 16:11:59 -07:00 committed by Ed Sanders
parent ec99401072
commit 0e47032839
2 changed files with 11 additions and 7 deletions

View file

@ -36,13 +36,18 @@
.ve-ui-mwLatexDialog-preview {
text-align: center;
line-height: 10em;
height: 10em;
line-height: 8em;
height: 8em;
}
.ve-ui-mwLatexDialog-menuLayout-short .ve-ui-mwLatexDialog-preview {
line-height: 6em;
height: 6em;
line-height: 5em;
height: 5em;
}
/* Reset line height for error messages */
.ve-ui-mwLatexDialog-preview > p {
line-height: 1.6;
}
/* Ensures the preview image is vertically centred */

View file

@ -16,11 +16,9 @@
* @constructor
* @param {Object} [config] Configuration options
*/
ve.ui.MWLatexDialog = function VeUiMWLatexDialog( config ) {
// Parent constructor
ve.ui.MWLatexDialog.super.call( this, config );
};
/* Inheritance */
@ -289,7 +287,8 @@ ve.ui.MWLatexDialog.prototype.onWindowManagerResize = function () {
setTimeout( function () {
// Give the input the right number of rows to fit the space
availableSpace = dialog.menuLayout.$content.height() - dialog.input.$element.position().top;
singleLineHeight = 19;
// TODO: Compute this line height from the skin
singleLineHeight = 21;
maxInputHeight = availableSpace - borderAndPadding;
minRows = Math.floor( maxInputHeight / singleLineHeight );
dialog.input.loadingPromise.done( function () {