mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
2f8b3e0d96
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
33 lines
831 B
JavaScript
33 lines
831 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWLinkMenuOptionWidget class
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see http://ve.mit-license.org
|
|
*/
|
|
|
|
/**
|
|
* Creates a ve.ui.MWLinkMenuOptionWidget object.
|
|
*
|
|
* @class
|
|
* @extends OO.ui.MenuOptionWidget
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Configuration options
|
|
* @cfg {string} [href] href to point to pages from link suggestions
|
|
*/
|
|
ve.ui.MWLinkMenuOptionWidget = function VeUiMWLinkMenuOptionWidget( config ) {
|
|
// Config initialization
|
|
config = config || {};
|
|
|
|
// Parent constructor
|
|
ve.ui.MWLinkMenuOptionWidget.super.call( this, config );
|
|
|
|
// initialization
|
|
this.$label.wrap( '<a>' );
|
|
this.$link = this.$label.parent();
|
|
this.$link.attr( 'href', config.href );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWLinkMenuOptionWidget, OO.ui.MenuOptionWidget );
|