Merge "Remove unused code from ve.ui.MWTransclusionOutlinePartWidget"

This commit is contained in:
jenkins-bot 2021-08-19 13:43:26 +00:00 committed by Gerrit Code Review
commit 2326468533
2 changed files with 9 additions and 20 deletions

View file

@ -110,7 +110,7 @@ ve.ui.MWTransclusionOutlineContainerWidget.prototype.addPartWidget = function (
widget = new ve.ui.MWTransclusionOutlineWikitextWidget( part );
}
widget.connect( this, { partHeaderClick: 'focusPart' } );
widget.connect( this, { headerClick: 'focusPart' } );
this.partWidgets[ part.getId() ] = widget;
if ( typeof newPosition === 'number' && newPosition < this.$element.children().length ) {

View file

@ -20,20 +20,16 @@
*/
ve.ui.MWTransclusionOutlinePartWidget = function VeUiMWTransclusionOutlinePartWidget( part, config ) {
// Parent constructor
ve.ui.MWTransclusionOutlinePartWidget.super.call( this, config );
ve.ui.MWTransclusionOutlinePartWidget.super.call( this, ve.extendObject( config, {
data: part.getId()
} ) );
// FIXME: Use config.data and OO.ui.Element.getData() instead?
// Warning, there is already config.id and this.elementId!
this.partId = part.getId();
this.header = new ve.ui.MWTransclusionOutlineButtonWidget( config )
var header = new ve.ui.MWTransclusionOutlineButtonWidget( config )
.connect( this, { click: 'onHeaderClick' } );
this.$element
.addClass( 've-ui-mwTransclusionOutlinePartWidget' )
// Note: There is no code that uses this. It just helps when manually inspecting the HTML.
.attr( 'data-transclusion-part-id', part.getId() )
.append( this.header.$element );
.append( header.$element );
};
/* Inheritance */
@ -43,20 +39,13 @@ OO.inheritClass( ve.ui.MWTransclusionOutlinePartWidget, OO.ui.Widget );
/* Events */
/**
* @event partHeaderClick
* @event headerClick
* @param {string} partId
*/
/**
* @return {string} Identifier of the {@see ve.dm.MWTransclusionPartModel} this widget represents
*/
ve.ui.MWTransclusionOutlinePartWidget.prototype.getPartId = function () {
return this.partId;
};
/**
* @fires partHeaderClick
* @fires headerClick
*/
ve.ui.MWTransclusionOutlinePartWidget.prototype.onHeaderClick = function () {
this.emit( 'partHeaderClick', this.partId );
this.emit( 'headerClick', this.data );
};