Jforrester has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/148577

Change subject: Clamp height of MWReferenceDialog to between 300 and 400px to 
avoid it being too small
......................................................................

Clamp height of MWReferenceDialog to between 300 and 400px to avoid it being 
too small

Bug: 68232
Change-Id: If32edc5622565b28ae1f6a2423a7c2289965733c
---
M modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/77/148577/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
index 6b32b40..839c772 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
@@ -218,7 +218,14 @@
  * @inheritdoc
  */
 ve.ui.MWReferenceDialog.prototype.getBodyHeight = function () {
-       return Math.min( 400, Math.ceil( 
this.panels.getCurrentItem().$element[0].scrollHeight ) );
+       // Clamp value to between 300 and 400px height, preferring the actual 
height if available
+       return Math.min(
+               400,
+               Math.max(
+                       300,
+                       Math.ceil( 
this.panels.getCurrentItem().$element[0].scrollHeight )
+               )
+       );
 };
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/148577
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If32edc5622565b28ae1f6a2423a7c2289965733c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to