From df7d20e65607db808d7f9a703561c7830deac743 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 29 Jul 2010 13:45:55 -0500 Subject: [PATCH] show/hide the version tag box appropriately --- www/extras/admin/admin.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/www/extras/admin/admin.js b/www/extras/admin/admin.js index 40473b33a..d688af09f 100644 --- a/www/extras/admin/admin.js +++ b/www/extras/admin/admin.js @@ -342,6 +342,15 @@ WebGUI.Admin.prototype.addHelperHandler */ WebGUI.Admin.prototype.updateCurrentVersionTag = function ( tag ) { + if ( !tag ) { + // hide tag area + document.getElementById( 'versionTag' ).style.display = "none"; + return; + } + + // Make sure tag is shown now + document.getElementById( 'versionTag' ).style.display = "block"; + var editEl = document.getElementById( 'editTag' ); editEl.innerHTML = tag.name; editEl.href = tag.editUrl; @@ -362,9 +371,7 @@ WebGUI.Admin.prototype.requestUpdateCurrentVersionTag var callback = { success : function (o) { var tag = YAHOO.lang.JSON.parse( o.responseText ); - if ( tag ) { - this.updateCurrentVersionTag( tag ); - } + this.updateCurrentVersionTag( tag ); }, failure : function (o) {