From 3d85791a03259dfb940548cbaaaecee01377725a Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 12 Oct 2009 09:53:13 +0000 Subject: [PATCH] fix a bug in converting non-boolean values back to boolean in the options manager --- deluge/ui/web/js/Deluge.OptionsManager.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deluge/ui/web/js/Deluge.OptionsManager.js b/deluge/ui/web/js/Deluge.OptionsManager.js index d90d54057..ab86c5cfd 100644 --- a/deluge/ui/web/js/Deluge.OptionsManager.js +++ b/deluge/ui/web/js/Deluge.OptionsManager.js @@ -207,7 +207,12 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { value = Number(value); break; case 'boolean': - value = Boolean(value); + if (Ext.type(value) == 'string') { + value = value.toLowerCase(); + value = (value == 'true' || value == '1' || value == 'on') ? true : false; + } else { + value = Boolean(value); + } break; } } @@ -243,7 +248,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { * @private */ onFieldChange: function(field, event) { - this.update(field._doption, field.getValue()); + this.update(field._doption, field.getValue()); }, /** @@ -268,4 +273,4 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { bind.setValue(newValue); }, this) } -}); \ No newline at end of file +});