Browse Source

WebUI: Update title immediately when showing/hiding rates

adaptive-webui-19844
Gabriele 10 years ago
parent
commit
6ee1c8851f
  1. 17
      src/webui/www/public/scripts/client.js
  2. 17
      src/webui/www/public/scripts/mocha-init.js

17
src/webui/www/public/scripts/client.js

@ -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',

17
src/webui/www/public/scripts/mocha-init.js

@ -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) {

Loading…
Cancel
Save