From 7e509f8d480b24aafc45320f39532e443a35a66b Mon Sep 17 00:00:00 2001 From: Daniel Erat Date: Mon, 30 May 2011 18:34:05 -0700 Subject: [PATCH] camlistored: enable permanode form when name isn't set --- server/go/camlistored/ui/permanode.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/go/camlistored/ui/permanode.js b/server/go/camlistored/ui/permanode.js index 2bbfce991..e8f2d7e1e 100644 --- a/server/go/camlistored/ui/permanode.js +++ b/server/go/camlistored/ui/permanode.js @@ -71,13 +71,16 @@ window.addEventListener("load", function (e) { alert("blob " + permanode + " isn't a permanode"); return; } - if (permanodeObject.attr.name && permanodeObject.attr.name.length == 1) { - var inputName = document.getElementById("inputName"); - inputName.value = permanodeObject.attr.name[0]; - inputName.disabled = null; - var btnSave = document.getElementById("btnSave"); - btnSave.disabled = null; - } + + var inputName = document.getElementById("inputName"); + inputName.value = + (permanodeObject.attr.name && permanodeObject.attr.name.length == 1) ? + permanodeObject.attr.name[0] : + ""; + inputName.disabled = null; + + var btnSave = document.getElementById("btnSave"); + btnSave.disabled = null; }, failure: function(msg) { alert("failed to get blob description: " + msg); } });