mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
2997cee444
Change-Id: Icf78d3d599326d3f12d09edcd2b8491ed35ade04
34 lines
876 B
JavaScript
34 lines
876 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWLinkMenuOptionWidget class
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see http://ve.mit-license.org
|
|
*/
|
|
|
|
/**
|
|
* Creates a ve.ui.MWLinkMenuOptionWidget object.
|
|
*
|
|
* @class
|
|
* @extends OO.ui.MenuOptionWidget
|
|
*
|
|
* @constructor
|
|
* @param {Mixed} data Item data
|
|
* @param {Object} [config] Configuration options
|
|
* @cfg {string} [href] href to point to pages from link suggestions
|
|
*/
|
|
ve.ui.MWLinkMenuOptionWidget = function VeUiMWLinkMenuOptionWidget( data, config ) {
|
|
// Config initialization
|
|
config = config || {};
|
|
|
|
// Parent constructor
|
|
ve.ui.MWLinkMenuOptionWidget.super.call( this, data, 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 );
|