From d128378f5a9001121b50e61c64888627f6fd125c Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Thu, 23 Oct 2014 19:37:50 +0100 Subject: [PATCH] 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 --- modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index 923c5dabfc..0b1fcbffd6 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -165,6 +165,10 @@ ve.ui.MWTransclusionDialog.prototype.onReplacePart = function ( 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(); label = ve.msg( 'visualeditor-dialog-action-insert' );