From c3bf2577daa876df19c1e436f1835d484d8e7912 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Wed, 25 Sep 2013 21:16:06 +0100 Subject: [PATCH] webui: fix display issue for boolean values --- src/webui/static/app/idnode.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 1d950e81..db451474 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -267,6 +267,9 @@ tvheadend.idnode_editor_field = function(f, create) { var d = f.rdonly || false; if (f.wronly && !create) d = false; + var value = f.value; + if (value == null) + value = f.default; /* Enumerated (combobox) type */ if (f.enum) { @@ -276,7 +279,7 @@ tvheadend.idnode_editor_field = function(f, create) return new cons({ fieldLabel : f.caption, name : f.id, - value : f.value || f.default, + value : value, disabled : d, width : 300, mode : 'local', @@ -308,7 +311,7 @@ tvheadend.idnode_editor_field = function(f, create) return new Ext.form.TextField({ fieldLabel : f.caption, name : f.id, - value : f.value || f.default, + value : value, disabled : d, width : 300 }); @@ -318,7 +321,7 @@ tvheadend.idnode_editor_field = function(f, create) return new Ext.form.Checkbox({ fieldLabel : f.caption, name : f.id, - checked : f.value || f.default, + checked : value, disabled : d }); break; @@ -330,7 +333,7 @@ tvheadend.idnode_editor_field = function(f, create) return new Ext.form.NumberField({ fieldLabel : f.caption, name : f.id, - value : f.value || f.default, + value : value, disabled : d, width : 300 });