2014-11-06 01:18:37 +00:00
|
|
|
/*!
|
2014-11-20 17:05:47 +00:00
|
|
|
* VisualEditor UserInterface MWLinkMenuOptionWidget class.
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
2014-11-20 17:05:47 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
2014-11-06 01:18:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-11-20 01:02:44 +00:00
|
|
|
* Creates a ve.ui.MWLinkMenuOptionWidget object.
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
|
|
|
* @class
|
2014-11-20 01:02:44 +00:00
|
|
|
* @extends OO.ui.MenuOptionWidget
|
2014-11-06 01:18:37 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
* @cfg {string} [href] href to point to pages from link suggestions
|
|
|
|
*/
|
2014-11-22 01:40:00 +00:00
|
|
|
ve.ui.MWLinkMenuOptionWidget = function VeUiMWLinkMenuOptionWidget( config ) {
|
2014-11-21 13:00:50 +00:00
|
|
|
// Config initialization
|
2014-11-20 17:05:47 +00:00
|
|
|
config = $.extend( { icon: null }, config );
|
2014-11-06 01:18:37 +00:00
|
|
|
|
|
|
|
// Parent constructor
|
2014-11-22 01:40:00 +00:00
|
|
|
ve.ui.MWLinkMenuOptionWidget.super.call( this, config );
|
2014-11-06 01:18:37 +00:00
|
|
|
|
2014-11-21 13:00:50 +00:00
|
|
|
// initialization
|
2014-11-06 01:18:37 +00:00
|
|
|
this.$label.wrap( '<a>' );
|
|
|
|
this.$link = this.$label.parent();
|
|
|
|
this.$link.attr( 'href', config.href );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-11-20 01:02:44 +00:00
|
|
|
OO.inheritClass( ve.ui.MWLinkMenuOptionWidget, OO.ui.MenuOptionWidget );
|