mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
allow set to take an object of options and also update bound fields after the set
This commit is contained in:
parent
deac8e0128
commit
be07281207
1 changed files with 11 additions and 2 deletions
|
@ -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 {String} option
|
||||||
* @param {Object} value The value for the option
|
* @param {Object} value The value for the option
|
||||||
*/
|
*/
|
||||||
set: function(option, value) {
|
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)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue