Skip to content

Commit f46b9b9

Browse files
authored
fix(js): tab navigation logic and validation in admin panel (#1004)
1 parent f387fb5 commit f46b9b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/scripts/sourcebans.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ function ProcessAdminTabs()
6565
const pos = url.indexOf('^') + 1;
6666
const tabNo = url.charAt(pos);
6767

68-
if(Number.isInteger(tabNo))
68+
if (!isNaN(utabNo))
6969
swapTab(tabNo);
7070

7171
const upos = url.indexOf('~') + 1;
7272
const utabNo = url.charAt(upos + 1);
7373
const utabType = url.charAt(upos);
7474

75-
if(Number.isInteger(utabNo))
75+
if (!isNaN(utabNo))
7676
Swap2ndPane(utabNo, utabType);
7777
}
7878

@@ -1472,6 +1472,6 @@ function openTab(event, target) {
14721472

14731473
function swapTab(tab) {
14741474
const menu = document.getElementById('admin-page-menu').children;
1475-
if(Number.isInteger(tab) && tab <= menu.length)
1475+
if(!isNaN(tab) && tab <= menu.length)
14761476
menu[tab].click();
14771477
}

0 commit comments

Comments
 (0)