Merge "RedirectSpecialArticle: Fix PHP notice about undefined index"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.NamespacesMenuOptionWidget.js
1 /*!
2 * MediaWiki Widgets - NamespacesMenuOptionWidget class.
3 *
4 * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
6 */
7 ( function () {
8
9 /**
10 * Creates an mw.widgets.NamespacesMenuOptionWidget object
11 *
12 * This MenuOptionWidget widget returns an item match text that includes
13 * both the label and the data, so the menu can filter on either.
14 *
15 * @class
16 * @extends OO.ui.MenuOptionWidget
17 *
18 * @constructor
19 * @param {Object} [config] Configuration options
20 */
21 mw.widgets.NamespacesMenuOptionWidget = function MwWidgetsNamespacesMenuOptionWidget( config ) {
22 // Parent
23 mw.widgets.NamespacesMenuOptionWidget.parent.call( this, config );
24 };
25
26 /* Setup */
27
28 OO.inheritClass( mw.widgets.NamespacesMenuOptionWidget, OO.ui.MenuOptionWidget );
29
30 /**
31 * @inheritdoc
32 */
33 mw.widgets.NamespacesMenuOptionWidget.prototype.getMatchText = function () {
34 return this.getData() + ' ' + this.getLabel();
35 };
36
37 }() );