From a5e6cd256c98ae72e6f65ca852a8d9f488f52d2d Mon Sep 17 00:00:00 2001 From: buinsky Date: Sun, 10 Jan 2016 12:00:29 +0300 Subject: [PATCH 1/2] WebUI: Fix deleting torrents Fix possible showing "qBittorrent client is not reachable" message on deleting torrents. --- src/webui/www/public/confirmdeletion.html | 1 + src/webui/www/public/scripts/dynamicTable.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webui/www/public/confirmdeletion.html b/src/webui/www/public/confirmdeletion.html index b31869ea6..828f1d54b 100644 --- a/src/webui/www/public/confirmdeletion.html +++ b/src/webui/www/public/confirmdeletion.html @@ -15,6 +15,7 @@ window.parent.closeWindows(); }); $('confirmBtn').addEvent('click', function(e){ + parent.torrentsTable.deselectAll(); new Event(e).stop(); var cmd = 'command/delete'; if($('deleteFromDiskCB').get('checked')) diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index aa1aa9cea..739f71bb8 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -194,6 +194,10 @@ var DynamicTable = new Class({ } }, + deselectAll : function () { + this.cur.empty(); + }, + selectRow : function (rowId) { this.cur.empty(); this.cur.push(rowId); @@ -423,7 +427,7 @@ var DynamicTable = new Class({ }, selectedRowsIds : function () { - return this.cur; + return this.cur.slice(); }, getRowIds : function () { From 165ab473df86e7a80b8872543148dbcff99f940a Mon Sep 17 00:00:00 2001 From: buinsky Date: Sun, 10 Jan 2016 12:11:54 +0300 Subject: [PATCH 2/2] WebUI: Fix torrent table context menu Don't show "Limit download speed" menu item for downloaded torrents. --- src/webui/www/public/scripts/contextmenu.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webui/www/public/scripts/contextmenu.js b/src/webui/www/public/scripts/contextmenu.js index ff427a66c..066696878 100644 --- a/src/webui/www/public/scripts/contextmenu.js +++ b/src/webui/www/public/scripts/contextmenu.js @@ -181,6 +181,8 @@ var ContextMenu = new Class({ show_f_l_piece_prio = false; if (all_are_downloaded) { + this.hideItem('DownloadLimit'); + this.menu.getElement('a[href$=UploadLimit]').parentNode.addClass('separator'); this.hideItem('SequentialDownload'); this.hideItem('FirstLastPiecePrio'); this.showItem('SuperSeeding'); @@ -204,6 +206,8 @@ var ContextMenu = new Class({ this.setItemChecked('SequentialDownload', all_are_seq_dl); this.setItemChecked('FirstLastPiecePrio', all_are_f_l_piece_prio); + this.showItem('DownloadLimit'); + this.menu.getElement('a[href$=UploadLimit]').parentNode.removeClass('separator'); this.hideItem('SuperSeeding'); }