From 81d28b686f0ae2966f8d07b9c9588c1ea2b2d7d5 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sun, 14 Mar 2010 08:46:21 +0000 Subject: [PATCH] add a failure callback when uploading a torrent file --- deluge/ui/web/js/deluge-all/Deluge.Add.File.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deluge/ui/web/js/deluge-all/Deluge.Add.File.js b/deluge/ui/web/js/deluge-all/Deluge.Add.File.js index 31bf844dc..bbbf7001d 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.Add.File.js +++ b/deluge/ui/web/js/deluge-all/Deluge.Add.File.js @@ -80,6 +80,7 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, { this.form.getForm().submit({ url: '/upload', waitMsg: _('Uploading your torrent...'), + failure: this.onUploadFailure, success: this.onUploadSuccess, scope: this }); @@ -92,6 +93,10 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, { info['filename'] = request.options.filename; this.fireEvent('add', this.torrentId, info); }, + + onUploadFailure: function(form, action) { + this.hide(); + }, onUploadSuccess: function(fp, upload) { this.hide();