Commit 7c0affd2 by NGUYEN HOANG SON

#49148 fix footer active tab

parent f0f4181e
...@@ -213,16 +213,16 @@ ...@@ -213,16 +213,16 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$("#footer").load("main-footer.html", function() { $("#footer").load("main-footer.html", function() {
if (location.hash === '#dashboard') { if (!sessionStorage.activeTab) {
CHK_Footer.goDashboard();
} else if (location.hash === '#operationList') {
CHK_Footer.goOperationList();
} else {
if (CHK.dashboardSetting.dashboardHome) { if (CHK.dashboardSetting.dashboardHome) {
CHK_Footer.goDashboard(); CHK_Footer.goDashboard();
} else { } else {
CHK_Footer.goOperationList(); CHK_Footer.goOperationList();
} }
} else if (sessionStorage.activeTab === 'dashboard') {
CHK_Footer.goDashboard();
} else if (sessionStorage.activeTab === 'operationList') {
CHK_Footer.goOperationList();
} }
}); });
}); });
......
...@@ -49,8 +49,9 @@ CHK_Footer.isIndexPage = function() { ...@@ -49,8 +49,9 @@ CHK_Footer.isIndexPage = function() {
return false; return false;
} }
CHK_Footer.goIndexPage = function(param) { CHK_Footer.goIndexPage = function(tabId) {
var href = 'index.html' + param; var href = 'index.html';
sessionStorage.activeTab = tabId;
location.href = href; location.href = href;
} }
...@@ -60,20 +61,22 @@ CHK_Footer.activeDashboardBottomNav = function() { ...@@ -60,20 +61,22 @@ CHK_Footer.activeDashboardBottomNav = function() {
} }
CHK_Footer.goDashboard = function() { CHK_Footer.goDashboard = function() {
sessionStorage.activeTab = 'dashboard';
CHK_Footer.activeDashboardBottomNav(); CHK_Footer.activeDashboardBottomNav();
if (CHK_Footer.isIndexPage()) { if (CHK_Footer.isIndexPage()) {
CHK_Footer.showPage('dashboard'); CHK_Footer.showPage('dashboard');
return; return;
} }
CHK_Footer.goIndexPage('#dashboard'); CHK_Footer.goIndexPage('dashboard');
} }
CHK_Footer.goOperationList = function() { CHK_Footer.goOperationList = function() {
sessionStorage.activeTab = 'operationList';
CHK_Footer.inactiveAllBottomNav(); CHK_Footer.inactiveAllBottomNav();
CHK_Footer.activeBottomNav('operationListBottomNav'); CHK_Footer.activeBottomNav('operationListBottomNav');
if (CHK_Footer.isIndexPage()) { if (CHK_Footer.isIndexPage()) {
CHK_Footer.showPage('operationList'); CHK_Footer.showPage('operationList');
return; return;
} }
CHK_Footer.goIndexPage('#operationList'); CHK_Footer.goIndexPage('operationList');
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment