mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 02:51:50 +00:00
170ca9d58a
This introduces another generic "button-like" class that can be reused in multiple places in the new sidebar. The main change in this patch is the "add more information" button which is now an instance of this new class as well. This patch also simplifies over-complicated setup code in related widgets. Bug: T274544 Change-Id: I0cfe7675d02fdd5c5dc8d9198bb3f4aec9abf397
25 lines
758 B
JavaScript
25 lines
758 B
JavaScript
/**
|
|
* @class
|
|
* @extends ve.ui.MWTransclusionOutlinePartWidget
|
|
*
|
|
* @constructor
|
|
* @param {ve.dm.MWTemplatePlaceholderModel} placeholder
|
|
*/
|
|
ve.ui.MWTransclusionOutlinePlaceholderWidget = function VeUiMWTransclusionOutlinePlaceholderWidget( placeholder ) {
|
|
var label = placeholder.getTransclusion().getParts().length === 1 ?
|
|
ve.msg( 'visualeditor-dialog-transclusion-template-search' ) :
|
|
ve.msg( 'visualeditor-dialog-transclusion-add-template' );
|
|
|
|
// Parent constructor
|
|
ve.ui.MWTransclusionOutlinePlaceholderWidget.super.call( this, placeholder, {
|
|
icon: 'puzzle',
|
|
label: label
|
|
} );
|
|
|
|
this.placeholder = placeholder;
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWTransclusionOutlinePlaceholderWidget, ve.ui.MWTransclusionOutlinePartWidget );
|