mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-25 09:35:16 +00:00
fix the onResize method for the togglefield so it resizes the textfield to the correct size
This commit is contained in:
parent
a126081d2c
commit
040f1a5c6d
@ -39,7 +39,7 @@ Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
|||||||
title: _('Downloads'),
|
title: _('Downloads'),
|
||||||
layout: 'form',
|
layout: 'form',
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
width: 300
|
width: 320
|
||||||
}, config);
|
}, config);
|
||||||
Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config);
|
Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config);
|
||||||
},
|
},
|
||||||
@ -56,7 +56,7 @@ Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
|||||||
defaultType: 'togglefield',
|
defaultType: 'togglefield',
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
labelAlign: 'top',
|
labelAlign: 'top',
|
||||||
width: 260,
|
width: 300,
|
||||||
style: 'margin-bottom: 5px; padding-bottom: 5px;'
|
style: 'margin-bottom: 5px; padding-bottom: 5px;'
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -64,13 +64,13 @@ Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
|||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
name: 'download_location',
|
name: 'download_location',
|
||||||
fieldLabel: _('Download to'),
|
fieldLabel: _('Download to'),
|
||||||
width: 240
|
width: 280
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var field = fieldset.add({
|
var field = fieldset.add({
|
||||||
name: 'move_completed_path',
|
name: 'move_completed_path',
|
||||||
fieldLabel: _('Move completed to'),
|
fieldLabel: _('Move completed to'),
|
||||||
width: 240
|
width: 280
|
||||||
});
|
});
|
||||||
optMan.bind('move_completed', field.toggle);
|
optMan.bind('move_completed', field.toggle);
|
||||||
optMan.bind('move_completed_path', field.input);
|
optMan.bind('move_completed_path', field.input);
|
||||||
@ -78,7 +78,7 @@ Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
|||||||
field = fieldset.add({
|
field = fieldset.add({
|
||||||
name: 'torrentfiles_location',
|
name: 'torrentfiles_location',
|
||||||
fieldLabel: _('Copy of .torrent files to'),
|
fieldLabel: _('Copy of .torrent files to'),
|
||||||
width: 240
|
width: 280
|
||||||
});
|
});
|
||||||
optMan.bind('copy_torrent_file', field.toggle);
|
optMan.bind('copy_torrent_file', field.toggle);
|
||||||
optMan.bind('torrentfiles_location', field.input);
|
optMan.bind('torrentfiles_location', field.input);
|
||||||
@ -86,7 +86,7 @@ Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
|||||||
field = fieldset.add({
|
field = fieldset.add({
|
||||||
name: 'autoadd_location',
|
name: 'autoadd_location',
|
||||||
fieldLabel: _('Autoadd .torrent files from'),
|
fieldLabel: _('Autoadd .torrent files from'),
|
||||||
width: 240
|
width: 280
|
||||||
});
|
});
|
||||||
optMan.bind('autoadd_enable', field.toggle);
|
optMan.bind('autoadd_enable', field.toggle);
|
||||||
optMan.bind('autoadd_location', field.input);
|
optMan.bind('autoadd_location', field.input);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -67,6 +67,10 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
|
|||||||
onResize: function(w, h) {
|
onResize: function(w, h) {
|
||||||
this.panel.setSize(w, h);
|
this.panel.setSize(w, h);
|
||||||
this.panel.doLayout();
|
this.panel.doLayout();
|
||||||
|
|
||||||
|
// we substract 10 for the padding :-)
|
||||||
|
var inputWidth = w - this.toggle.getSize().width - 10;
|
||||||
|
this.input.setSize(inputWidth, h);
|
||||||
},
|
},
|
||||||
|
|
||||||
onToggleCheck: function(toggle, checked) {
|
onToggleCheck: function(toggle, checked) {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user