mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-30 13:16:17 +00:00
fix tracking spinner values
This commit is contained in:
parent
6d83556ba8
commit
1c807ad7c8
@ -210,34 +210,5 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
|
||||
this.fireEvent('changed', this.currentId, option, value, oldValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Event Handlers
|
||||
/**
|
||||
* Stops a form fields value from being blocked by the change functions
|
||||
* @param {Ext.form.Field} field
|
||||
* @private
|
||||
*/
|
||||
onFieldChange: function(field, event) {
|
||||
this.update(field._doption, field.getValue());
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles updating binds when an option's value is changed.
|
||||
* @param {String} id The current option id
|
||||
* @param {String} option The option that has changed.
|
||||
* @param {Mixed} newValue The new value
|
||||
* @private
|
||||
*/
|
||||
onChange: function(id, option, newValue, oldValue) {
|
||||
// If we don't have a bind there's nothing to do.
|
||||
if (Ext.isEmpty(this.binds[option])) return;
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
@ -97,6 +97,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
||||
field.on('blur', this.onFieldBlur, this);
|
||||
field.on('change', this.onFieldChange, this);
|
||||
field.on('check', this.onFieldChange, this);
|
||||
field.on('spin', this.onFieldChange, this);
|
||||
return field;
|
||||
},
|
||||
|
||||
@ -261,6 +262,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
||||
* @private
|
||||
*/
|
||||
onFieldChange: function(field, event) {
|
||||
if (field.field) field = field.field // fix for spinners
|
||||
this.update(field._doption, field.getValue());
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user