From 6ee1c8851f65e8d6c1bc341e0a25fffc7844b669 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Sun, 30 Nov 2014 14:35:26 +0100 Subject: [PATCH] WebUI: Update title immediately when showing/hiding rates --- src/webui/www/public/scripts/client.js | 17 +++++++++++++++++ src/webui/www/public/scripts/mocha-init.js | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index 81abb7c0a..ba4b6d2bf 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -233,6 +233,23 @@ window.addEvent('load', function () { updateTransferList(); }; + updateSpeedInBrowserTitleBarLinkCheckState = function() { + if (localStorage.getItem('speed_in_browser_title_bar') == 'true') + $(speedInBrowserTitleBarLink).firstChild.style.opacity = '1'; + else + $(speedInBrowserTitleBarLink).firstChild.style.opacity = '0'; + } + + updateSpeedInBrowserTitleBarLinkCheckState(); + + addClickEvent('speedInBrowserTitleBar', function() { + var speed_in_browser_title_bar = localStorage.getItem('speed_in_browser_title_bar'); + speed_in_browser_title_bar = speed_in_browser_title_bar == 'true' ? 'false' : 'true'; + localStorage.setItem('speed_in_browser_title_bar', speed_in_browser_title_bar); + updateSpeedInBrowserTitleBarLinkCheckState(); + updateTransferInfo(); + }); + new MochaUI.Panel({ id : 'transferList', title : 'Panel', diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index 0249011ae..25ef028c8 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -314,23 +314,6 @@ initializeWindows = function() { }).send(); }); - updateSpeedInBrowserTitleBarLinkCheckState = function() { - if (localStorage.getItem('speed_in_browser_title_bar') == 'true') - $(speedInBrowserTitleBarLink).firstChild.style.opacity = '1'; - else - $(speedInBrowserTitleBarLink).firstChild.style.opacity = '0'; - } - - updateSpeedInBrowserTitleBarLinkCheckState(); - - addClickEvent('speedInBrowserTitleBar', function(e) { - new Event(e).stop(); - var speed_in_browser_title_bar = localStorage.getItem('speed_in_browser_title_bar'); - speed_in_browser_title_bar = speed_in_browser_title_bar == 'true' ? 'false' : 'true'; - localStorage.setItem('speed_in_browser_title_bar', speed_in_browser_title_bar); - updateSpeedInBrowserTitleBarLinkCheckState(); - }); - // Deactivate menu header links $$('a.returnFalse').each(function(el) { el.addEvent('click', function(e) {