mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-09-23 18:29:39 +00:00
Fix auto-height when CodeMirror not available
Change-Id: I0e88b12b0e67f471bac8ab767cdeca8ac7bafeec
This commit is contained in:
parent
fa583e68e7
commit
23054cfe5b
|
@ -274,12 +274,11 @@ ve.ui.MWLatexDialog.prototype.getBodyHeight = function () {
|
|||
*/
|
||||
ve.ui.MWLatexDialog.prototype.onWindowManagerResize = function () {
|
||||
var dialog = this;
|
||||
this.input.loadingPromise.done( function () {
|
||||
this.input.loadingPromise.always( function () {
|
||||
var availableSpace, maxInputHeight, singleLineHeight, minRows,
|
||||
border = 1,
|
||||
padding = 3,
|
||||
borderAndPadding = 2 * ( border + padding );
|
||||
|
||||
// Toggle short mode as necessary
|
||||
// NB a change of mode triggers a transition...
|
||||
dialog.menuLayout.$element.toggleClass(
|
||||
|
@ -293,7 +292,11 @@ ve.ui.MWLatexDialog.prototype.onWindowManagerResize = function () {
|
|||
singleLineHeight = 19;
|
||||
maxInputHeight = availableSpace - borderAndPadding;
|
||||
minRows = Math.floor( maxInputHeight / singleLineHeight );
|
||||
dialog.input.setMinRows( minRows );
|
||||
dialog.input.loadingPromise.done( function () {
|
||||
dialog.input.setMinRows( minRows );
|
||||
} ).fail( function () {
|
||||
dialog.input.$input.attr( 'rows', minRows );
|
||||
} );
|
||||
}, OO.ui.theme.getDialogTransitionDuration() );
|
||||
} );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue