Author: damoxc

Revision: 4911

Log:
        move the clearing to the selectionchange event of the grid so it 
happens immediately

Diff:
Modified: trunk/deluge/ui/web/js/deluge-details.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-details.js    2009-03-21 11:53:05 UTC (rev 
4910)
+++ trunk/deluge/ui/web/js/deluge-details.js    2009-03-21 12:02:18 UTC (rev 
4911)
@@ -31,10 +31,7 @@
        
        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 @@
 
        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));
        },
        



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to