From eeb3ac3b19b0250f95181b1ad6b003ade8d1bc66 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 16 Sep 2013 16:53:20 +0100 Subject: [PATCH] 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 --- .../init/targets/ve.init.mw.ViewPageTarget.js | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 83f6c1ab5b..4c21f2a8dc 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -1030,25 +1030,28 @@ ve.init.mw.ViewPageTarget.prototype.setupToolbarBetaNotice = function () { .attr( 'target', '_blank' ) .attr( 'href', new mw.Title( ve.msg( 'visualeditor-help-link' ) ).getUrl() ) .text( ve.msg( 'visualeditor-help-label' ) ) - ) ) ) - .append( $( '
' ) - .append( $( '' ) - .addClass( 've-init-mw-ViewPageTarget-version-label' ) - .text( ve.msg( 'visualeditor-version-label' ) ) - ) - .append( ' ' ) - .append( $( '' ) - .addClass( 've-init-mw-ViewPageTarget-version-link' ) - .attr( 'target', '_blank' ) - .attr( 'href', ve.version.url ) - .text( ve.version.id ) - ) - .append( ' ' ) - .append( $( '' ) - .addClass( 've-init-mw-ViewPageTarget-version-date' ) - .text( ve.version.dateString ) - ) - ); + ) ) ); + if ( ve.version.id !== false ) { + this.$toolbarBetaNotice + .append( $( '
' ) + .append( $( '' ) + .addClass( 've-init-mw-ViewPageTarget-version-label' ) + .text( ve.msg( 'visualeditor-version-label' ) ) + ) + .append( ' ' ) + .append( $( '' ) + .addClass( 've-init-mw-ViewPageTarget-version-link' ) + .attr( 'target', '_blank' ) + .attr( 'href', ve.version.url ) + .text( ve.version.id ) + ) + .append( ' ' ) + .append( $( '' ) + .addClass( 've-init-mw-ViewPageTarget-version-date' ) + .text( ve.version.dateString ) + ) + ); + } }; /**