move the clearing to the selectionchange event of the grid so it happens immediately
This commit is contained in:
parent
c143891c93
commit
856cd63421
|
@ -31,10 +31,7 @@ Deluge.Details = {
|
||||||
|
|
||||||
update: function(tab) {
|
update: function(tab) {
|
||||||
var torrent = Deluge.Torrents.getSelected();
|
var torrent = Deluge.Torrents.getSelected();
|
||||||
if (!torrent) {
|
if (!torrent) return;
|
||||||
this.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tab = tab || this.Panel.getActiveTab();
|
tab = tab || this.Panel.getActiveTab();
|
||||||
if (tab.update) {
|
if (tab.update) {
|
||||||
|
@ -44,6 +41,13 @@ Deluge.Details = {
|
||||||
|
|
||||||
onRender: function(panel) {
|
onRender: function(panel) {
|
||||||
Deluge.Torrents.Grid.on('rowclick', this.onTorrentsClick.bindWithEvent(this));
|
Deluge.Torrents.Grid.on('rowclick', this.onTorrentsClick.bindWithEvent(this));
|
||||||
|
|
||||||
|
var selModel = Deluge.Torrents.Grid.getSelectionModel();
|
||||||
|
selModel.on('selectionchange', function(selModel) {
|
||||||
|
if (!selModel.hasSelection()) {
|
||||||
|
this.clear.delay(10, this);
|
||||||
|
}
|
||||||
|
}.bindWithEvent(this));
|
||||||
Deluge.Events.on('disconnect', this.clear.bind(this));
|
Deluge.Events.on('disconnect', this.clear.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue