Author: damoxc

Revision: 6165

Log:
        stop the torrent grid from resetting its position upon update

Diff:
Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.Torrents.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.Torrents.js        2010-01-28 
22:49:56 UTC (rev 6164)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.Torrents.js        2010-01-29 
11:04:26 UTC (rev 6165)
@@ -235,6 +235,10 @@
                return this.getStore().getAt(index);
        },
 
+       /**
+        * Returns the currently selected records.
+        * @ return {Array/Ext.data.Record} The record(s) representing the rows
+        */
        getSelected: function() {
        return this.getSelectionModel().getSelected();
        },
@@ -243,11 +247,16 @@
                return this.getSelectionModel().getSelections();
        },
 
-       update: function(torrents, bulk) {
-               var store = this.getStore();
-               store.loadData({"torrents": Ext.values(torrents)});
+       update: function(torrents) {
+               // NOTE: this isn't published in the API docs so may disappear 
unexpectedly
+               // when upgrading Ext Js.
+               var scroller = this.getView().scroller.dom;
+               var scrollTop = scroller.scrollTop;
+               this.getStore().loadData({"torrents": Ext.values(torrents)});
+               scroller.scrollTop = scrollTop;
        },
 
+       // private
        onDisconnect: function() {
                this.getStore().removeAll();
        },


-- 
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