From be07281207cb1998c348dcb2686daeeab8c0ff1c Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 28 Jul 2009 22:31:57 +0000 Subject: [PATCH] allow set to take an object of options and also update bound fields after the set --- deluge/ui/web/js/Deluge.OptionsManager.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/Deluge.OptionsManager.js b/deluge/ui/web/js/Deluge.OptionsManager.js index 2416c14ab..33b337275 100644 --- a/deluge/ui/web/js/Deluge.OptionsManager.js +++ b/deluge/ui/web/js/Deluge.OptionsManager.js @@ -153,12 +153,21 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { }, /** - * Sets the value of specified option for the passed in id. + * Sets the value of specified option(s) for the passed in id. * @param {String} option * @param {Object} value The value for the option */ set: function(option, value) { - this.options[option] = value; + if (typeof option == 'object') { + var options = option; + this.options = Ext.apply(this.options, options); + for (var option in options) { + this.onChange(option, options[option]); + } + } else { + this.options[option] = value; + this.onChange(option, value) + } }, /**