Fix resizing bug

The bug was that when resizing the window, it always jumped to the Colors tab instead of staying on the currently selected tab.
pull/3945/head
Woody 2024-04-30 16:53:47 +02:00
rodzic 9f99a1896d
commit ff10130176
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 9872D7F5072789B2
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -304,7 +304,6 @@ function updateTablinks(tabI)
{
var tablinks = gEBCN("tablinks");
for (var i of tablinks) i.classList.remove('active');
if (pcMode) return;
tablinks[tabI].classList.add('active');
}
@ -3047,12 +3046,11 @@ function togglePcMode(fromB = false)
if (fromB) {
pcModeA = !pcModeA;
localStorage.setItem('pcm', pcModeA);
openTab(0, true);
}
pcMode = (wW >= 1024) && pcModeA;
if (cpick) cpick.resize(pcMode && wW>1023 && wW<1250 ? 230 : 260); // for tablet in landscape
if (!fromB && ((wW < 1024 && lastw < 1024) || (wW >= 1024 && lastw >= 1024))) return; // no change in size and called from size()
openTab(0, true);
updateTablinks(0);
gId('buttonPcm').className = (pcMode) ? "active":"";
gId('bot').style.height = (pcMode && !cfg.comp.pcmbot) ? "0":"auto";
sCol('--bh', gId('bot').clientHeight + "px");