From c405425993e5a6aeb343cb974d114f9e38dca757 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 4 Nov 2011 00:44:56 +0000 Subject: web: fix details tab taking a while to update Somewhere the handler for the torrent grid selection change got removed during the upgrade to ext-4, add it back so the details tab updating becomes instant once more. --- deluge/ui/web/js/deluge-all/TorrentGrid.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js index 1f9a5e510..72cf6ebcb 100644 --- a/deluge/ui/web/js/deluge-all/TorrentGrid.js +++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js @@ -240,11 +240,15 @@ Ext.define('Deluge.TorrentGrid', { } }), + viewConfig: { + stateId: 'torrentGridView', + stateful: true + }, + id: 'torrentGrid', region: 'center', cls: 'deluge-torrents', stripeRows: true, - autoScroll:true, deferredRender:false, invalidateScrollOnRefresh: false, margins: '5 5 0 0', @@ -255,6 +259,29 @@ Ext.define('Deluge.TorrentGrid', { deluge.events.on('disconnect', this.onDisconnect, this); this.on('itemcontextmenu', this.onTorrentSelected, this); + + this.on('staterestore', function(stateful, state, eopts) { + deluge.log('grid restoring state'); + }); + + this.on('selectionchange', function(grid, selected) { + if (selected.length) + deluge.details.update(); + else + deluge.details.clear(); + }); + + this.on('statesave', function() { + deluge.log('grid saving state'); + }); + + this.getView().on('statesave', function() { + deluge.log('view saving state'); + }); + + this.getView().on('staterestore', function(stateful, state, eopts) { + deluge.log('view restoring state'); + }); }, /** -- cgit