/**
* @param array $config Configuration options
* @param int|null $config['namespace'] Namespace to prepend to queries
- * @param bool|null $config['relative'] If a namespace is set, return a title relative to it (default; true)
+ * @param bool|null $config['relative'] If a namespace is set, return a title relative to it (default: true)
*/
public function __construct( array $config = array() ) {
// Parent constructor
data: this.namespace !== null && this.relative
? mwTitle.getRelativeText( this.namespace )
: title,
+ title: mwTitle,
imageUrl: this.showImages ? data.imageUrl : null,
description: this.showDescriptions ? data.description : null,
missing: data.missing,
*
* @constructor
* @param {Object} [config] Configuration options
- * @cfg {string} [data] Page title
+ * @cfg {string} [data] Label to display
+ * @cfg {mw.Title} [title] Page title object
* @cfg {string} [imageUrl] Thumbnail image URL with URL encoding
* @cfg {string} [description] Page description
* @cfg {boolean} [missing] Page doesn't exist
* @cfg {string} [query] Matching query string
*/
mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
- var icon, title = config.data;
+ var icon;
if ( config.missing ) {
icon = 'page-not-found';
// Config initialization
config = $.extend( {
icon: icon,
- label: title,
- href: mw.util.getUrl( title ),
+ label: config.data,
+ href: config.title.getUrl(),
autoFitLabel: false
}, config );