From 1c807ad7c8aa0af920de384f8b8c48ba004d1818 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 30 Mar 2010 14:27:41 +0100 Subject: [PATCH] fix tracking spinner values --- .../web/js/deluge-all/MultiOptionsManager.js | 29 ------------------- deluge/ui/web/js/deluge-all/OptionsManager.js | 2 ++ 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/MultiOptionsManager.js b/deluge/ui/web/js/deluge-all/MultiOptionsManager.js index 154d842ba..79ff9166b 100644 --- a/deluge/ui/web/js/deluge-all/MultiOptionsManager.js +++ b/deluge/ui/web/js/deluge-all/MultiOptionsManager.js @@ -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); } }); diff --git a/deluge/ui/web/js/deluge-all/OptionsManager.js b/deluge/ui/web/js/deluge-all/OptionsManager.js index ba5c60623..abbcbb54d 100644 --- a/deluge/ui/web/js/deluge-all/OptionsManager.js +++ b/deluge/ui/web/js/deluge-all/OptionsManager.js @@ -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()); },