Show name of template for invisible templates

Soft dependency on Id842389d in core.

Bug: T141861
Change-Id: I24f100dde387549a735ebd93e1c9a21f59f52170
This commit is contained in:
Ed Sanders 2016-08-02 11:43:17 +01:00 committed by Jforrester
parent d9d7aec0b0
commit 4ae7bc6a31
2 changed files with 26 additions and 14 deletions

View file

@ -116,6 +116,19 @@ ve.ce.MWTransclusionNode.static.filterRendering = function ( contentNodes ) {
/* Methods */ /* Methods */
/**
* @inheritdoc
*/
ve.ce.MWTransclusionNode.prototype.createInvisibleIcon = function () {
var icon = new OO.ui.ButtonWidget( {
classes: [ 've-ce-focusableNode-invisibleIcon' ],
framed: false,
icon: this.constructor.static.iconWhenInvisible,
label: this.constructor.static.getDescription( this.getModel() )
} );
return icon.$element;
};
/** /**
* @inheritdoc * @inheritdoc
*/ */
@ -162,6 +175,14 @@ ve.ce.MWTransclusionNode.prototype.onParseSuccess = function ( deferred, respons
ve.ce.MWTransclusionNode.prototype.render = function ( generatedContents ) { ve.ce.MWTransclusionNode.prototype.render = function ( generatedContents ) {
// Call parent mixin // Call parent mixin
ve.ce.GeneratedContentNode.prototype.render.call( this, generatedContents ); ve.ce.GeneratedContentNode.prototype.render.call( this, generatedContents );
};
/**
* @inheritdoc
*/
ve.ce.MWTransclusionNode.prototype.onSetup = function () {
// Parent method
ve.ce.MWTransclusionNode.super.prototype.onSetup.apply( this, arguments );
// Render replaces this.$element with a new node so re-add classes // Render replaces this.$element with a new node so re-add classes
this.$element.addClass( 've-ce-mwTransclusionNode' ); this.$element.addClass( 've-ce-mwTransclusionNode' );

View file

@ -5,20 +5,11 @@
* @license The MIT License (MIT); see LICENSE.txt * @license The MIT License (MIT); see LICENSE.txt
*/ */
.ve-ce-mwTransclusionNode.oo-ui-iconElement { .ve-ce-mwTransclusionNode > .ve-ce-focusableNode-invisibleIcon.oo-ui-iconElement {
display: inline-block; font-size: 0.914286em;
vertical-align: middle; width: auto;
padding: 0.2em;
margin: -0.25em 0.15em 0 0.15em;
} }
.ve-ce-mwTransclusionNode.oo-ui-iconElement .oo-ui-iconElement-icon { .ve-ce-mwTransclusionNode.ve-ce-focusableNode-invisible {
display: inline-block; width: auto;
vertical-align: middle;
width: 1.25em;
height: 1.25em;
background-repeat: no-repeat;
background-position: center center;
background-size: 24px 24px; /* stylelint-disable-line no-unsupported-browser-features */
opacity: 0.5;
} }