Fix #2212 : WebUI: Unable to scroll in proxy preferences page

This commit is contained in:
Calum Lind 2012-11-24 10:50:11 +00:00
parent 3e98ef5f89
commit aaf4aa5226

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.ProxyPage.js * Deluge.preferences.ProxyPage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,11 +40,12 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
config = Ext.apply({ config = Ext.apply({
border: false, border: false,
title: _('Proxy'), title: _('Proxy'),
layout: 'form' layout: 'form',
autoScroll: true
}, config); }, config);
Deluge.preferences.Proxy.superclass.constructor.call(this, config); Deluge.preferences.Proxy.superclass.constructor.call(this, config);
}, },
initComponent: function() { initComponent: function() {
Deluge.preferences.Proxy.superclass.initComponent.call(this); Deluge.preferences.Proxy.superclass.initComponent.call(this);
this.peer = this.add(new Deluge.preferences.ProxyField({ this.peer = this.add(new Deluge.preferences.ProxyField({
@ -52,28 +53,28 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
name: 'peer' name: 'peer'
})); }));
this.peer.on('change', this.onProxyChange, this); this.peer.on('change', this.onProxyChange, this);
this.web_seed = this.add(new Deluge.preferences.ProxyField({ this.web_seed = this.add(new Deluge.preferences.ProxyField({
title: _('Web Seed'), title: _('Web Seed'),
name: 'web_seed' name: 'web_seed'
})); }));
this.web_seed.on('change', this.onProxyChange, this); this.web_seed.on('change', this.onProxyChange, this);
this.tracker = this.add(new Deluge.preferences.ProxyField({ this.tracker = this.add(new Deluge.preferences.ProxyField({
title: _('Tracker'), title: _('Tracker'),
name: 'tracker' name: 'tracker'
})); }));
this.tracker.on('change', this.onProxyChange, this); this.tracker.on('change', this.onProxyChange, this);
this.dht = this.add(new Deluge.preferences.ProxyField({ this.dht = this.add(new Deluge.preferences.ProxyField({
title: _('DHT'), title: _('DHT'),
name: 'dht' name: 'dht'
})); }));
this.dht.on('change', this.onProxyChange, this); this.dht.on('change', this.onProxyChange, this);
deluge.preferences.getOptionsManager().bind('proxies', this); deluge.preferences.getOptionsManager().bind('proxies', this);
}, },
getValue: function() { getValue: function() {
return { return {
'dht': this.dht.getValue(), 'dht': this.dht.getValue(),
@ -82,18 +83,18 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
'web_seed': this.web_seed.getValue() 'web_seed': this.web_seed.getValue()
} }
}, },
setValue: function(value) { setValue: function(value) {
for (var proxy in value) { for (var proxy in value) {
this[proxy].setValue(value[proxy]); this[proxy].setValue(value[proxy]);
} }
}, },
onProxyChange: function(field, newValue, oldValue) { onProxyChange: function(field, newValue, oldValue) {
var newValues = this.getValue(); var newValues = this.getValue();
var oldValues = Ext.apply({}, newValues); var oldValues = Ext.apply({}, newValues);
oldValues[field.getName()] = oldValue; oldValues[field.getName()] = oldValue;
this.fireEvent('change', this, newValues, oldValues); this.fireEvent('change', this, newValues, oldValues);
} }
}); });