diff --git a/public/index.html b/public/index.html index d8eb50e..5813f86 100644 --- a/public/index.html +++ b/public/index.html @@ -188,7 +188,8 @@
-
Option Positions
Live
+
Option Positions
Live
+
@@ -367,12 +368,20 @@ async function loadPositions(){ // Build expiry tabs const expiries=['ALL',...new Set(open.map(p=>expiryLabel(p.tradingsymbol)))].filter(Boolean); - const tabsEl=document.getElementById('expiry-tabs'); - if(tabsEl&&expiries.length>2){ - tabsEl.innerHTML=expiries.map(e=> - '' - ).join(''); - } else if(tabsEl){ tabsEl.innerHTML=''; } + // Use the row OUTSIDE card-head so clicks don't bubble to toggleCard + var tabsEl=document.getElementById('expiry-tabs-row'); + if(tabsEl){ + if(expiries.length>2){ + tabsEl.style.display='flex'; + tabsEl.innerHTML=expiries.map(function(e){ + return ''; + }).join(''); + } else { + tabsEl.style.display='none'; + tabsEl.innerHTML=''; + } + } // Filter by active expiry const filtered=_activeExpiry==='ALL'?open:open.filter(p=>expiryLabel(p.tradingsymbol)===_activeExpiry); @@ -744,9 +753,12 @@ async function loadClosedPositions() { } -function setExpiry(exp){ +function setExpiry(btn,exp){ _activeExpiry=exp; - // Re-render positions with new filter (re-use cached data via refresh) + // Update active tab styling + var row=document.getElementById('expiry-tabs-row'); + if(row) row.querySelectorAll('.exp-tab').forEach(function(b){b.classList.remove('active');}); + if(btn) btn.classList.add('active'); loadPositions(); } loadConfig();refresh();
SymbolQtyLTPAvg CostUnrealisedRealisedTotal P&L
Loading…