* @param {Object} config Configuration options
* @cfg {string} data Label to display
* @cfg {string} url URL of page
+ * @cfg {boolean} [showImages] Whether to attempt to show images
* @cfg {string} [imageUrl] Thumbnail image URL with URL encoding
* @cfg {string} [description] Page description
* @cfg {boolean} [missing] Page doesn't exist
mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
var icon;
- if ( config.missing ) {
+ if ( !config.showImages ) {
+ icon = null;
+ } else if ( config.missing ) {
icon = 'page-not-found';
} else if ( config.redirect ) {
icon = 'page-redirect';
this.$label.addClass( 'mw-disambig' );
}
- if ( config.imageUrl ) {
+ if ( config.showImages && config.imageUrl ) {
this.$icon
.addClass( 'mw-widget-titleOptionWidget-hasImage' )
.css( 'background-image', 'url(' + config.imageUrl + ')' );
mwTitle.getRelativeText( this.namespace ) :
title,
url: mwTitle.getUrl(),
+ showImages: this.showImages,
imageUrl: this.showImages ? data.imageUrl : null,
description: this.showDescriptions ? description : null,
missing: data.missing,