mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
MediaContext: Link filename to file page
Change-Id: Ice3fdd40cd1f7b8ba2841ac326babc7f24a2635e
This commit is contained in:
parent
c245dd9ca0
commit
10792e179f
|
@ -65,6 +65,21 @@ ve.ui.MWMediaContextItem.prototype.getDescription = function () {
|
|||
return ve.ce.nodeFactory.getDescription( this.model );
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWMediaContextItem.prototype.renderBody = function () {
|
||||
this.$body.append(
|
||||
$( '<a>' )
|
||||
.text( this.getDescription() )
|
||||
.attr( {
|
||||
href: mw.util.getUrl( this.model.getAttribute( 'resource' ) ),
|
||||
target: '_blank',
|
||||
rel: 'noopener'
|
||||
} )
|
||||
);
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
||||
ve.ui.contextItemFactory.register( ve.ui.MWMediaContextItem );
|
||||
|
|
Loading…
Reference in a new issue