From 856cd63421cf692526be9d797999ed6744e9a062 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 21 Mar 2009 12:02:18 +0000 Subject: [PATCH] move the clearing to the selectionchange event of the grid so it happens immediately --- deluge/ui/web/js/deluge-details.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deluge/ui/web/js/deluge-details.js b/deluge/ui/web/js/deluge-details.js index 8892d6ff2..2e5443f4f 100644 --- a/deluge/ui/web/js/deluge-details.js +++ b/deluge/ui/web/js/deluge-details.js @@ -31,10 +31,7 @@ Deluge.Details = { update: function(tab) { var torrent = Deluge.Torrents.getSelected(); - if (!torrent) { - this.clear(); - return; - } + if (!torrent) return; tab = tab || this.Panel.getActiveTab(); if (tab.update) { @@ -44,6 +41,13 @@ Deluge.Details = { onRender: function(panel) { 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)); },