Fix #2037: webui 'Add Torrents' dialog torrents list not scrolling

This commit is contained in:
Calum Lind 2012-02-23 00:13:27 +00:00
parent 0ccf0730ea
commit 38210ae11e
1 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/*!
* Deluge.add.AddWindow.js
*
*
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -50,7 +50,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
this.addButton(_('Cancel'), this.onCancelClick, this);
this.addButton(_('Add'), this.onAddClick, this);
function torrentRenderer(value, p, r) {
if (r.data['info_hash']) {
return String.format('<div class="x-deluge-add-torrent-name">{0}</div>', value);
@ -73,7 +73,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
sortable: true,
renderer: torrentRenderer,
dataIndex: 'text'
}],
}],
stripeRows: true,
singleSelect: true,
listeners: {
@ -84,6 +84,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
},
hideHeaders: true,
autoExpandColumn: 'torrent',
height: '100%',
autoScroll: true
});
@ -114,7 +115,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
}]
})
});
this.optionsPanel = this.add(new Deluge.add.OptionsPanel());
this.on('hide', this.onHide, this);
this.on('show', this.onShow, this);
@ -165,12 +166,12 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
var torrent = this.list.getSelectedRecords()[0];
this.list.getStore().remove(torrent);
this.optionsPanel.clear();
if (this.torrents && this.torrents[torrent.id]) delete this.torrents[torrent.id];
},
onSelect: function(list, selections) {
if (selections.length) {
if (selections.length) {
var record = this.list.getRecord(selections[0]);
this.optionsPanel.setTorrent(record.get('info_hash'));
this.optionsPanel.files.setDisabled(false);
@ -193,7 +194,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
this.file.on('beforeadd', this.onTorrentBeforeAdd, this);
this.file.on('add', this.onTorrentAdd, this);
}
this.optionsPanel.form.getDefaults();
},