diff options
Diffstat (limited to 'ncp-web/js/ncp.js')
-rw-r--r-- | ncp-web/js/ncp.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ncp-web/js/ncp.js b/ncp-web/js/ncp.js index 4229a585..6c35db0c 100644 --- a/ncp-web/js/ncp.js +++ b/ncp-web/js/ncp.js @@ -14,13 +14,13 @@ var lock = false; // URL based navigation window.onpopstate = function(event) { - var ncp_app = location.search.split('=')[1]; - if (ncp_app == 'config') + selectedID = location.search.split('=')[1]; + if (selectedID == 'config') switch_to_section('nc-config'); - else if (ncp_app == 'dashboard') + else if (selectedID == 'dashboard') switch_to_section('dashboard'); else - app_clicked($('#' + ncp_app)); + app_clicked($('#' + selectedID)); }; function errorMsg() @@ -158,6 +158,10 @@ function app_clicked(item) $(function() { + // parse selected app from URL + if (location.search) + selectedID = location.search.split('=')[1]; + // Event source to receive process output in real time if (!!window.EventSource) var source = new EventSource('ncp-output.php'); |