Merge "Highlight matching parts of link suggestions"

This commit is contained in:
jenkins-bot 2015-05-05 10:12:28 +00:00 committed by Gerrit Code Review
commit 7d85bc3ae3
2 changed files with 6 additions and 2 deletions

View file

@ -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 */

View file

@ -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
} ) );
}