Hide version info if not available

Sometimes GitInfo returns a version ID of false if it can't
find the right files. In this case we should hide the whole
message as it is meaningless.

Bug: 53050
Change-Id: I71161df7588aa9311bc1fdf6b064cc6d8c155f61
This commit is contained in:
Ed Sanders 2013-09-16 16:53:20 +01:00
parent 019a6f8e49
commit eeb3ac3b19

View file

@ -1030,25 +1030,28 @@ ve.init.mw.ViewPageTarget.prototype.setupToolbarBetaNotice = function () {
.attr( 'target', '_blank' ) .attr( 'target', '_blank' )
.attr( 'href', new mw.Title( ve.msg( 'visualeditor-help-link' ) ).getUrl() ) .attr( 'href', new mw.Title( ve.msg( 'visualeditor-help-link' ) ).getUrl() )
.text( ve.msg( 'visualeditor-help-label' ) ) .text( ve.msg( 'visualeditor-help-label' ) )
) ) ) ) ) );
.append( $( '<div>' ) if ( ve.version.id !== false ) {
.append( $( '<span>' ) this.$toolbarBetaNotice
.addClass( 've-init-mw-ViewPageTarget-version-label' ) .append( $( '<div>' )
.text( ve.msg( 'visualeditor-version-label' ) ) .append( $( '<span>' )
) .addClass( 've-init-mw-ViewPageTarget-version-label' )
.append( ' ' ) .text( ve.msg( 'visualeditor-version-label' ) )
.append( $( '<a>' ) )
.addClass( 've-init-mw-ViewPageTarget-version-link' ) .append( ' ' )
.attr( 'target', '_blank' ) .append( $( '<a>' )
.attr( 'href', ve.version.url ) .addClass( 've-init-mw-ViewPageTarget-version-link' )
.text( ve.version.id ) .attr( 'target', '_blank' )
) .attr( 'href', ve.version.url )
.append( ' ' ) .text( ve.version.id )
.append( $( '<span>' ) )
.addClass( 've-init-mw-ViewPageTarget-version-date' ) .append( ' ' )
.text( ve.version.dateString ) .append( $( '<span>' )
) .addClass( 've-init-mw-ViewPageTarget-version-date' )
); .text( ve.version.dateString )
)
);
}
}; };
/** /**