Author: damoxc
Revision: 5693
Log:
add support for binding an option to multiple fields
Diff:
Modified: trunk/deluge/ui/web/js/Deluge.OptionsManager.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.OptionsManager.js 2009-08-20 00:55:58 UTC
(rev 5692)
+++ trunk/deluge/ui/web/js/Deluge.OptionsManager.js 2009-08-20 01:08:09 UTC
(rev 5693)
@@ -78,7 +78,8 @@
* @param {Ext.form.Field} field
*/
bind: function(option, field) {
- this.binds[option] = field;
+ this.binds[option] = this.binds[option] || [];
+ this.binds[option].push(field);
field._doption = option;
field.on('focus', this.onFieldFocus, this);
@@ -258,11 +259,13 @@
// If we don't have a bind there's nothing to do.
if (Ext.isEmpty(this.binds[option])) return;
- // The field is currently focused so we don't want to change
- // it.
- if (this.binds[option] == this.focused) return;
-
- // Set the form field to the new value.
- this.binds[option].setValue(newValue);
+ Ext.each(this.binds[option], function(bind) {
+ // The field is currently focused so we don't want to
+ // change it.
+ if (bind == this.focused) return;
+
+ // Set the form field to the new value.
+ bind.setValue(newValue);
+ }, this)
}
});
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---