Skip to content

Commit

Permalink
fix(js): tab navigation logic and validation in admin panel (sbpp#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushaway authored Nov 10, 2024
1 parent f387fb5 commit f46b9b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/scripts/sourcebans.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ function ProcessAdminTabs()
const pos = url.indexOf('^') + 1;
const tabNo = url.charAt(pos);

if(Number.isInteger(tabNo))
if (!isNaN(utabNo))
swapTab(tabNo);

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

if(Number.isInteger(utabNo))
if (!isNaN(utabNo))
Swap2ndPane(utabNo, utabType);
}

Expand Down Expand Up @@ -1472,6 +1472,6 @@ function openTab(event, target) {

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

0 comments on commit f46b9b9

Please sign in to comment.