fix: update cookie handling in tab management

- Removed unused cookie helper functions from MainContentTabbed.php to streamline the code.
- Updated the tab management logic to ensure cookies are cleared when no cookie exists, aligning with the behavior of the initab function.
- Corrected the filename reference in MainContent.php from 'MainContentNotab.php' to 'MainContentNoTab.php' for consistency.
This commit is contained in:
Zack Spear
2025-05-07 15:20:16 -07:00
parent ad9f54618c
commit 648d9252cc
3 changed files with 10 additions and 29 deletions

View File

@@ -101,28 +101,12 @@ function refresh(top) {
}
}
function initab(page) {
function initab(page) { // @todo remove in the future
$.removeCookie('one');
$.removeCookie('tab');
if (page != null) location.replace(page);
}
function settab(tab) {
<?switch ($myPage['name']):?>
<?case'Main':?>
$.cookie('tab',tab);
<?if (_var($var,'fsState')=='Started'):?>
$.cookie('one','tab1');
<?endif;?>
<?break;?>
<?case'Cache':case'Data':case'Device':case'Flash':case'Parity':?>
$.cookie('one',tab);
<?break;?>
<?default:?>
$.cookie('one',tab);
<?endswitch;?>
}
function done(key) {
var url = location.pathname.split('/');
var path = '/'+url[1];