From c4332fe9a9a81cf2dd00c0bef40406520580e16e Mon Sep 17 00:00:00 2001 From: buinsky Date: Fri, 30 Jan 2015 00:16:28 +0300 Subject: [PATCH] Add processing double click on torrent Starting/pausing torrent by double-clicking on it. --- src/webui/www/public/scripts/dynamicTable.js | 11 +++++++++++ src/webui/www/public/scripts/mocha-init.js | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index 018164d52..c54152bdb 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -356,6 +356,17 @@ var dynamicTable = new Class({ myTable.selectRow(this.hash); return true; }); + tr.addEvent('dblclick', function (e) { + e.stop(); + myTable.selectRow(this.hash); + var row = myTable.rows.get(this.hash); + var state = row['full_data'].state; + if (~state.indexOf('paused')) + startFN(); + else + pauseFN(); + return true; + }); tr.addEvent('click', function (e) { e.stop(); if (e.control) { diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index c5af9a377..d14dbb669 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -30,6 +30,8 @@ function getLocalStorageItem(name, defaultVal) { } var deleteFN = function() {}; +var startFN = function() {}; +var pauseFN = function() {}; initializeWindows = function() {