Esanders has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/404699 )
Change subject: Resize link context item after getting description
......................................................................
Resize link context item after getting description
Descriptions can run to more than two lines.
Bug: T183650
Change-Id: I3d0a5787cab19abc4851340b08fe4a109e7aec31
---
M modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/99/404699/1
diff --git a/modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js
b/modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js
index 53078e1..a6112e6 100644
--- a/modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js
+++ b/modules/ve-mw/ui/contextitems/ve.ui.MWInternalLinkContextItem.js
@@ -41,9 +41,10 @@
* @param {ve.init.mw.LinkCache} linkCache The link cache to use
* @param {ve.dm.MWInternalLinkAnnotation} model The annotation model
* @param {HTMLDocument} htmlDoc The HTML document (for URL resolution)
+ * @param {ve.ui.Context} context Context (for resizing)
* @return {jQuery} The jQuery object of the link context item
*/
-ve.ui.MWInternalLinkContextItem.static.generateBody = function ( linkCache,
model, htmlDoc ) {
+ve.ui.MWInternalLinkContextItem.static.generateBody = function ( linkCache,
model, htmlDoc, context ) {
var icon, $description,
title = model.getAttribute( 'lookupTitle' ),
description = model.getAttribute( 'normalizedTitle' ),
@@ -95,6 +96,8 @@
.addClass(
've-ui-mwInternalLinkContextItem-description' )
.text( linkData.description );
$wrapper.append( $description );
+ // Multiline descriptions may make the context
bigger (T183650)
+ context.updateDimensions();
}
} );
}
@@ -117,7 +120,8 @@
this.$body.empty().append( this.constructor.static.generateBody(
ve.init.platform.linkCache,
this.model,
-
this.context.getSurface().getModel().getDocument().getHtmlDocument()
+
this.context.getSurface().getModel().getDocument().getHtmlDocument(),
+ this.context
) );
};
--
To view, visit https://gerrit.wikimedia.org/r/404699
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d0a5787cab19abc4851340b08fe4a109e7aec31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits