mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 01:16:30 +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;
|
this.pagename = config.pagename;
|
||||||
|
|
||||||
// Parent constructor
|
// 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
|
// Style based on link cache information
|
||||||
ve.init.platform.linkCache.styleElement( this.pagename, this.$link );
|
ve.init.platform.linkCache.styleElement( this.pagename, this.$link );
|
||||||
|
@ -46,6 +46,9 @@ ve.ui.MWInternalLinkMenuOptionWidget = function VeUiMWInternalLinkMenuOptionWidg
|
||||||
.text( config.description )
|
.text( config.description )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Highlight matching parts of link suggestion
|
||||||
|
this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Inheritance */
|
/* Inheritance */
|
||||||
|
|
|
@ -320,7 +320,8 @@ ve.ui.MWLinkTargetInputWidget.prototype.getLookupMenuOptionsFromData = function
|
||||||
pagename: suggestionPages[i],
|
pagename: suggestionPages[i],
|
||||||
imageUrl: linkData.imageUrl,
|
imageUrl: linkData.imageUrl,
|
||||||
description: linkData.description,
|
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