Skip to content

Instantly share code, notes, and snippets.

@ankita-kumari
Created March 25, 2015 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankita-kumari/81c565c9e87217da1b54 to your computer and use it in GitHub Desktop.
Save ankita-kumari/81c565c9e87217da1b54 to your computer and use it in GitHub Desktop.
This leads to the button to become disabled when the page is rendered but with subsequent additions it does not become clickable.
ve.ui.MWTransclusionDialog.prototype.getPageFromPart = function ( part ) {
var page = ve.ui.MWTransclusionDialog.super.prototype.getPageFromPart.call( this, part );
if ( !page && part instanceof ve.dm.MWTransclusionContentModel ) {
return new ve.ui.MWTransclusionContentPage( part, part.getId(), { $: this.$ } );
}
var parts = this.transclusionModel.getParts();
if(parts.length === 1 && part instanceof ve.dm.MWTemplatePlaceholderModel)
{
page.removeButton.setDisabled( true );
}
return page;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment