implement moving trackers up/down

This commit is contained in:
Damien Churchill 2010-04-08 17:51:49 +01:00
parent 38c85cf7bb
commit 8e4d88f03c
1 changed files with 16 additions and 0 deletions

View File

@ -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');
}
});