mirror of
https://github.com/wled/WLED.git
synced 2025-04-24 06:47:18 +00:00
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.
This commit is contained in:
parent
9f99a1896d
commit
ff10130176
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user