mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-25 12:33:19 +00:00
a669a4fc52
For each template result, ask for the templatedata description. If that description exists, show it under the template result. Bug: T53436 Change-Id: If28d1eb082edca6f50c6c15c933a0b7d014eaeaf
36 lines
1,015 B
JavaScript
36 lines
1,015 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWTemplateMenuOptionWidget class
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see http://ve.mit-license.org
|
|
*/
|
|
|
|
/**
|
|
* Creates a ve.ui.MWTemplateMenuOptionWidget object.
|
|
*
|
|
* @class
|
|
* @extends OO.ui.MenuOptionWidget
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Configuration options
|
|
* @cfg {string} [templateName] Template name
|
|
* @cfg {string} [templateDescription] Template description
|
|
*/
|
|
ve.ui.MWTemplateMenuOptionWidget = function VeUiMWTemplateMenuOptionWidget( config ) {
|
|
// Configuration initialization
|
|
config = $.extend( { icon: 'check', data: config.templateName }, config );
|
|
|
|
// Parent constructor
|
|
ve.ui.MWTemplateMenuOptionWidget.super.call( this, config );
|
|
|
|
if ( config.templateDescription ) {
|
|
$( '<div>' )
|
|
.addClass( 've-ui-mwTemplateMenuOptionWidget-description' )
|
|
.text( config.templateDescription )
|
|
.appendTo( this.$element );
|
|
}
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWTemplateMenuOptionWidget, OO.ui.MenuOptionWidget );
|