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 () { @@ -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',

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

@ -314,23 +314,6 @@ initializeWindows = function() { @@ -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) {

Loading…
Cancel
Save