From 8e4d88f03c3b7cd5a98cf06ed648592e47f791b4 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 8 Apr 2010 17:51:49 +0100 Subject: [PATCH] implement moving trackers up/down --- .../ui/web/js/deluge-all/EditTrackersWindow.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deluge/ui/web/js/deluge-all/EditTrackersWindow.js b/deluge/ui/web/js/deluge-all/EditTrackersWindow.js index bbc3f82e4..eb4c9a3eb 100644 --- a/deluge/ui/web/js/deluge-all/EditTrackersWindow.js +++ b/deluge/ui/web/js/deluge-all/EditTrackersWindow.js @@ -188,6 +188,7 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, { onRequestComplete: function(status) { this.list.getStore().loadData(status); + this.list.getStore().sort('tier', 'ASC'); }, onSaveFail: function() { @@ -208,5 +209,20 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, { success: this.onRequestComplete, scope: this }); + }, + + onDownClick: function() { + var r = this.list.getSelectedRecords()[0]; + r.set('tier', r.get('tier') + 1); + r.commit(); + r.store.sort('tier', 'ASC'); + }, + + onUpClick: function() { + var r = this.list.getSelectedRecords()[0]; + if (r.get('tier') == 0) return; + r.set('tier', r.get('tier') - 1); + r.commit(); + r.store.sort('tier', 'ASC'); } });