From a9b8b7fd3a70da9e32dee70fba45723f986f6115 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 15 Nov 2016 10:13:50 +0800 Subject: webui: Change log toggle icons opacity according to toggle status --- fg21sim/webui/static/js/console.js | 1 + fg21sim/webui/static/js/websocket.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'fg21sim/webui/static/js') diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js index 14e0ad7..3dfd8b0 100644 --- a/fg21sim/webui/static/js/console.js +++ b/fg21sim/webui/static/js/console.js @@ -115,6 +115,7 @@ var toggleLogMessages = function (level) { logbox.data(level, status); console.log("Toggled", level, "logging messages:", status ? "show" : "hide"); + return status; } }; diff --git a/fg21sim/webui/static/js/websocket.js b/fg21sim/webui/static/js/websocket.js index 0fcf98e..1d739ae 100644 --- a/fg21sim/webui/static/js/websocket.js +++ b/fg21sim/webui/static/js/websocket.js @@ -239,19 +239,24 @@ $(document).ready(function () { /* Logging messages controls */ $("#log-toggle-debug").on("click", function () { - toggleLogMessages("debug"); + var status = toggleLogMessages("debug"); + $(this).fadeTo("fast", status ? 1.0 : 0.5); }); $("#log-toggle-info").on("click", function () { - toggleLogMessages("info"); + var status = toggleLogMessages("info"); + $(this).fadeTo("fast", status ? 1.0 : 0.5); }); $("#log-toggle-warning").on("click", function () { - toggleLogMessages("warning"); + var status = toggleLogMessages("warning"); + $(this).fadeTo("fast", status ? 1.0 : 0.5); }); $("#log-toggle-error").on("click", function () { - toggleLogMessages("error"); + var status = toggleLogMessages("error"); toggleLogMessages("critical"); + $(this).fadeTo("fast", status ? 1.0 : 0.5); }); $("#log-delete").on("click", function () { + // TODO: add a confirmation dialog deleteLogMessages(); }); -- cgit v1.2.2