WebUI: Update title immediately when showing/hiding rates

This commit is contained in:
Gabriele 2014-11-30 14:35:26 +01:00
parent 2226f166ac
commit 6ee1c8851f
2 changed files with 17 additions and 17 deletions

View file

@ -233,6 +233,23 @@ window.addEvent('load', function () {
updateTransferList(); 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({ new MochaUI.Panel({
id : 'transferList', id : 'transferList',
title : 'Panel', title : 'Panel',

View file

@ -314,23 +314,6 @@ initializeWindows = function() {
}).send(); }).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 // Deactivate menu header links
$$('a.returnFalse').each(function(el) { $$('a.returnFalse').each(function(el) {
el.addEvent('click', function(e) { el.addEvent('click', function(e) {