From 952dec199ae2605ac3b5e9dcee1db18f43b4efea Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 23 Nov 2010 16:53:29 -0800 Subject: [PATCH] bug 7262: global settings page - if no value is assigned, display "Not applicable". (merge from 2.2.beta1 branch to master branch) --- ui/scripts/cloud.core.globalsetting.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/scripts/cloud.core.globalsetting.js b/ui/scripts/cloud.core.globalsetting.js index 88bfabbe099..299f5e6f38e 100644 --- a/ui/scripts/cloud.core.globalsetting.js +++ b/ui/scripts/cloud.core.globalsetting.js @@ -58,11 +58,17 @@ function populateGlobalSettingGrid() { }); } +var notApplicable = "Not applicable"; var globalsettingGridIndex = 0; function globalsettingJSONToTemplate(jsonObj, template) { (globalsettingGridIndex++ % 2 == 0)? template.addClass("even"): template.addClass("odd"); template.find("#name").text(fromdb(jsonObj.name)); - template.find("#value").text(fromdb(jsonObj.value)); + + if(fromdb(jsonObj.value).length > 0) + template.find("#value").text(fromdb(jsonObj.value)); + else + template.find("#value").text(notApplicable); + template.find("#value_edit").val(fromdb(jsonObj.value)); template.find("#description").text(fromdb(jsonObj.description)); } @@ -90,7 +96,11 @@ function doEditGlobalSetting() { function doEditGlobalSetting2($readonlyFields, $editFields) { $("#right_panel_content #tab_content_details").find("#globalsetting_template").each(function(index) { - var $thisRow =$(this); + var $thisRow =$(this); + + if($thisRow.find("#value_edit").val() == "" && $thisRow.find("#value").text() == notApplicable) + return; + if($thisRow.find("#value_edit").val() != $thisRow.find("#value").text()) { // validate values var isValid = true;