Author: damoxc
Revision: 5561
Log:
allow set to take an object of options and also update bound fields
after the set
Diff:
Modified: trunk/deluge/ui/web/js/Deluge.OptionsManager.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.OptionsManager.js 2009-07-28 22:04:00 UTC
(rev 5560)
+++ trunk/deluge/ui/web/js/Deluge.OptionsManager.js 2009-07-28 22:31:57 UTC
(rev 5561)
@@ -153,12 +153,21 @@
},
/**
- * 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)
+ }
},
/**
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---