mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "Highlight matching parts of link suggestions"
This commit is contained in:
commit
7d85bc3ae3
|
@ -25,7 +25,7 @@ ve.ui.MWInternalLinkMenuOptionWidget = function VeUiMWInternalLinkMenuOptionWidg
|
|||
this.pagename = config.pagename;
|
||||
|
||||
// Parent constructor
|
||||
ve.ui.MWLinkMenuOptionWidget.call( this, $.extend( { label: this.pagename, href: mw.util.getUrl( this.pagename ) }, config ) );
|
||||
ve.ui.MWLinkMenuOptionWidget.call( this, $.extend( { label: this.pagename, href: mw.util.getUrl( this.pagename ), autoFitLabel: false }, config ) );
|
||||
|
||||
// Style based on link cache information
|
||||
ve.init.platform.linkCache.styleElement( this.pagename, this.$link );
|
||||
|
@ -46,6 +46,9 @@ ve.ui.MWInternalLinkMenuOptionWidget = function VeUiMWInternalLinkMenuOptionWidg
|
|||
.text( config.description )
|
||||
);
|
||||
}
|
||||
|
||||
// Highlight matching parts of link suggestion
|
||||
this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
|
|
@ -320,7 +320,8 @@ ve.ui.MWLinkTargetInputWidget.prototype.getLookupMenuOptionsFromData = function
|
|||
pagename: suggestionPages[i],
|
||||
imageUrl: linkData.imageUrl,
|
||||
description: linkData.description,
|
||||
icon: ve.init.platform.linkCache.constructor.static.getIconForLink( linkData )
|
||||
icon: ve.init.platform.linkCache.constructor.static.getIconForLink( linkData ),
|
||||
query: this.value
|
||||
} ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue