jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/403656 )
Change subject: Fix auto-height when CodeMirror not available
......................................................................
Fix auto-height when CodeMirror not available
Change-Id: I0e88b12b0e67f471bac8ab767cdeca8ac7bafeec
---
M modules/ve-math/ve.ui.MWLatexDialog.js
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
jenkins-bot: Verified
Jforrester: Looks good to me, approved
diff --git a/modules/ve-math/ve.ui.MWLatexDialog.js
b/modules/ve-math/ve.ui.MWLatexDialog.js
index 102500e..402976d 100644
--- a/modules/ve-math/ve.ui.MWLatexDialog.js
+++ b/modules/ve-math/ve.ui.MWLatexDialog.js
@@ -274,12 +274,11 @@
*/
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 @@
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() );
} );
};
--
To view, visit https://gerrit.wikimedia.org/r/403656
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0e88b12b0e67f471bac8ab767cdeca8ac7bafeec
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: DLynch <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits