From 06bf617885da69fb713cd598afc0fc03fdb9d63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Tue, 3 Jul 2018 06:49:09 +0900 Subject: [PATCH] Fix: tab content hide show bug --- src/web/js/maestro_main.js | 34 +++++++++++++----------- src/web/module/maestro_section_main.html | 6 ++--- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/web/js/maestro_main.js b/src/web/js/maestro_main.js index ef4c84a..440618f 100644 --- a/src/web/js/maestro_main.js +++ b/src/web/js/maestro_main.js @@ -160,6 +160,7 @@ function updatePlayerListPage(playerList) { function tabClicked(tabNo) { + // hide and show tab for(let i = 0; i < 4; i++) { $("#page-tabs li").filter(":eq(" + i + ")").removeClass("activated"); } @@ -167,30 +168,31 @@ function tabClicked(tabNo) { let tabIndex = tabNo - 1; $("#page-tabs li").filter(":eq(" + tabIndex + ")").addClass("activated"); + // hide and show content switch(tabNo) { case 1: - $(".player_list").removeClass("hide"); - $(".search").addClass("hide"); - $(".mouse_app_list").addClass("hide"); - $(".typing_app_list").addClass("hide"); + $("#section_add_player").removeClass("hide"); + $("#search").addClass("hide"); + $("#mouse_app_list").addClass("hide"); + $("#typing_app_list").addClass("hide"); break; case 2: - $(".player_list").addClass("hide"); - $(".search").removeClass("hide"); - $(".mouse_app_list").addClass("hide"); - $(".typing_app_list").addClass("hide"); + $("#section_add_player").addClass("hide"); + $("#search").removeClass("hide"); + $("#mouse_app_list").addClass("hide"); + $("#typing_app_list").addClass("hide"); break; case 3: - $(".player_list").addClass("hide"); - $(".search").addClass("hide"); - $(".mouse_app_list").removeClass("hide"); - $(".typing_app_list").addClass("hide"); + $("#section_add_player").addClass("hide"); + $("#search").addClass("hide"); + $("#mouse_app_list").removeClass("hide"); + $("#typing_app_list").addClass("hide"); break; case 4: - $(".player_list").addClass("hide"); - $(".search").addClass("hide"); - $(".mouse_app_list").addClass("hide"); - $(".typing_app_list").removeClass("hide"); + $("#section_add_player").addClass("hide"); + $("#search").addClass("hide"); + $("#mouse_app_list").addClass("hide"); + $("#typing_app_list").removeClass("hide"); break; } } diff --git a/src/web/module/maestro_section_main.html b/src/web/module/maestro_section_main.html index 0e72ba8..e3bb500 100644 --- a/src/web/module/maestro_section_main.html +++ b/src/web/module/maestro_section_main.html @@ -24,7 +24,7 @@ $(document).ready(function() {
-