From e6f2926ccde8d0cb650ca784a9499b59acef5832 Mon Sep 17 00:00:00 2001 From: ngosang Date: Sat, 13 Jun 2015 14:15:49 +0200 Subject: [PATCH] [Web UI] Don't update the tabs if tab's panel is collapsed --- src/webui/www/public/scripts/client.js | 4 ++++ src/webui/www/public/scripts/prop-files.js | 5 +++-- src/webui/www/public/scripts/prop-general.js | 3 ++- src/webui/www/public/scripts/prop-trackers.js | 5 +++-- src/webui/www/public/scripts/prop-webseeds.js | 3 ++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index 36c4f350b..7a58b3e46 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -392,6 +392,10 @@ window.addEvent('load', function () { $('prop_webseeds').addClass("invisible"); updatePropertiesPanel(); }); + + $('propertiesPanel_collapseToggle').addEvent('click', function(e){ + updatePropertiesPanel(); + }); }, column : 'mainColumn', height : prop_h diff --git a/src/webui/www/public/scripts/prop-files.js b/src/webui/www/public/scripts/prop-files.js index 8a37b7dc9..471e8bd4c 100644 --- a/src/webui/www/public/scripts/prop-files.js +++ b/src/webui/www/public/scripts/prop-files.js @@ -273,7 +273,8 @@ var filesDynTable = new Class({ var loadTorrentFilesDataTimer; var loadTorrentFilesData = function() { - if ($('prop_files').hasClass('invisible')) { + if ($('prop_files').hasClass('invisible') || + $('propertiesPanel_collapseToggle').hasClass('panel-expand')) { // Tab changed, don't do anything return; } @@ -347,4 +348,4 @@ var updateTorrentFilesData = function() { } fTable = new filesDynTable(); -fTable.setup($('filesTable')); \ No newline at end of file +fTable.setup($('filesTable')); diff --git a/src/webui/www/public/scripts/prop-general.js b/src/webui/www/public/scripts/prop-general.js index c470f609b..a364b88ec 100644 --- a/src/webui/www/public/scripts/prop-general.js +++ b/src/webui/www/public/scripts/prop-general.js @@ -16,7 +16,8 @@ var clearData = function() { var loadTorrentDataTimer; var loadTorrentData = function() { - if ($('prop_general').hasClass('invisible')) { + if ($('prop_general').hasClass('invisible') || + $('propertiesPanel_collapseToggle').hasClass('panel-expand')) { // Tab changed, don't do anything return; } diff --git a/src/webui/www/public/scripts/prop-trackers.js b/src/webui/www/public/scripts/prop-trackers.js index 1dd1df7f2..9bcb701da 100644 --- a/src/webui/www/public/scripts/prop-trackers.js +++ b/src/webui/www/public/scripts/prop-trackers.js @@ -54,7 +54,8 @@ var current_hash = ""; var loadTrackersDataTimer; var loadTrackersData = function() { - if ($('prop_trackers').hasClass('invisible')) { + if ($('prop_trackers').hasClass('invisible') || + $('propertiesPanel_collapseToggle').hasClass('panel-expand')) { // Tab changed, don't do anything return; } @@ -127,4 +128,4 @@ $('addTrackersPlus').addEvent('click', function addTrackerDlg() { width: 500, height: 250 }); -}); \ No newline at end of file +}); diff --git a/src/webui/www/public/scripts/prop-webseeds.js b/src/webui/www/public/scripts/prop-webseeds.js index 4aa6b2363..39a69421f 100644 --- a/src/webui/www/public/scripts/prop-webseeds.js +++ b/src/webui/www/public/scripts/prop-webseeds.js @@ -54,7 +54,8 @@ var current_hash = ""; var loadWebSeedsDataTimer; var loadWebSeedsData = function() { - if ($('prop_webseeds').hasClass('invisible')) { + if ($('prop_webseeds').hasClass('invisible') || + $('propertiesPanel_collapseToggle').hasClass('panel-expand')) { // Tab changed, don't do anything return; }