mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Enable template editor toolbar deeper in the stack
We can do this more in-place instead of reaching into the structure from the outside. Change-Id: I1beb5f7dcfef027f811a3bb4d2a2ef323e2535e3
This commit is contained in:
parent
e9560b58b9
commit
e338a3c35d
|
@ -174,7 +174,6 @@ ve.ui.MWTransclusionDialog.prototype.onReplacePart = function ( removed, added )
|
|||
if ( parts.length === 0 ) {
|
||||
this.addPart( new ve.dm.MWTemplatePlaceholderModel( this.transclusionModel ) );
|
||||
} else if ( parts.length > 1 ) {
|
||||
this.bookletLayout.getOutlineControls().toggle( true );
|
||||
this.$element.removeClass( 've-ui-mwTransclusionDialog-single-transclusion' );
|
||||
}
|
||||
|
||||
|
|
|
@ -84,10 +84,17 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onReplacePart = function ( rem
|
|||
this.sidebar.onReplacePart( removed, added, newPosition );
|
||||
|
||||
var keys = Object.keys( this.pages ),
|
||||
isMultiPart = keys.length > 1,
|
||||
isLastPlaceholder = keys.length === 1 &&
|
||||
this.pages[ keys[ 0 ] ] instanceof ve.ui.MWTemplatePlaceholderPage;
|
||||
|
||||
// TODO: In other cases this is disabled rather than hidden. See T311303
|
||||
this.outlineControlsWidget.removeButton.toggle( !isLastPlaceholder );
|
||||
|
||||
if ( isMultiPart ) {
|
||||
// Warning, this is intentionally never turned off again
|
||||
this.outlineControlsWidget.toggle( true );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue