Skip to content

Commit

Permalink
Fix resizing bug
Browse files Browse the repository at this point in the history
The bug was that when resizing the window, it always jumped to the Colors tab instead of staying on the currently selected tab.
  • Loading branch information
w00000dy committed Apr 30, 2024
1 parent 9f99a18 commit ff10130
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit ff10130

Please sign in to comment.