Disable parameter add icon when there's no transclusion parts

Would put this code in onBookletLayoutSet, but that doesn't appear to be
getting called in this case.

Have to detect whether or not we should be changing the disabled status, rather
than just setting it straight away, which would break every other case where
onBookletLayoutSet is called.

Bug: 63158
Change-Id: I6f62479291424d9b2ee0e42481dec9d085169c63
This commit is contained in:
Alex Monk 2014-10-23 19:37:50 +01:00
parent 50e59f328a
commit d128378f5a

View file

@ -165,6 +165,10 @@ ve.ui.MWTransclusionDialog.prototype.onReplacePart = function ( removed, added )
ve.ui.MWTransclusionDialog.super.prototype.onReplacePart.call( this, removed, added ); ve.ui.MWTransclusionDialog.super.prototype.onReplacePart.call( this, removed, added );
if ( this.transclusionModel.getParts().length === 0 ) {
this.addParameterButton.setDisabled( true );
}
single = this.isSingleTemplateTransclusion(); single = this.isSingleTemplateTransclusion();
label = ve.msg( 'visualeditor-dialog-action-insert' ); label = ve.msg( 'visualeditor-dialog-action-insert' );