From a9be584c0efab173171edb48d8f3a1db18af26d7 Mon Sep 17 00:00:00 2001 From: DiTus Date: Thu, 19 Mar 2026 22:49:51 +0100 Subject: [PATCH] feat: updated bottom menu toggle logic and hurst bands color --- index.html | 23 ++++++++++++++++++++--- js/ui/indicators-panel-new.js | 13 ++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index c242e94..a8bd749 100644 --- a/index.html +++ b/index.html @@ -158,7 +158,7 @@ show_chart Markets -
+
candlestick_chart Chart
@@ -184,7 +184,7 @@
- @@ -226,7 +226,17 @@ const sidebar = document.getElementById('rightSidebar'); if (!sidebar) return; - // Remove collapsed class to show + const isOpen = !sidebar.classList.contains('collapsed'); + const activeTab = document.querySelector('.sidebar-tab.active'); + const currentTabName = activeTab ? activeTab.dataset.tab : null; + + // If sidebar is open AND the clicked tab is already active, CLOSE IT. + if (isOpen && currentTabName === tabName) { + sidebar.classList.add('collapsed'); + return; // Done + } + + // Otherwise, OPEN it (remove collapsed) and switch tab sidebar.classList.remove('collapsed'); if (tabName) { @@ -237,6 +247,13 @@ } } }; + + window.hideAllPanels = function() { + const sidebar = document.getElementById('rightSidebar'); + if (sidebar) { + sidebar.classList.add('collapsed'); + } + }; diff --git a/js/ui/indicators-panel-new.js b/js/ui/indicators-panel-new.js index 287e18b..a86b927 100644 --- a/js/ui/indicators-panel-new.js +++ b/js/ui/indicators-panel-new.js @@ -773,18 +773,25 @@ function addIndicator(type) { // Override with Hurst-specific defaults if (type === 'hurst') { + const hurstCount = activeIndicators.filter(ind => ind.type === 'hurst').length; + const color = hurstCount > 0 ? '#ff9800' : '#9e9e9e'; + params._lineWidth = 1; params.timeframe = 'chart'; params.markerBuyShape = 'custom'; params.markerSellShape = 'custom'; - params.markerBuyColor = '#9e9e9e'; - params.markerSellColor = '#9e9e9e'; + params.markerBuyColor = color; + params.markerSellColor = color; params.markerBuyCustom = '▲'; params.markerSellCustom = '▼'; } metadata.plots.forEach((plot, idx) => { - params[`_color_${idx}`] = plot.color || getDefaultColor(activeIndicators.length + idx); + if (type === 'hurst' && activeIndicators.filter(ind => ind.type === 'hurst').length > 0) { + params[`_color_${idx}`] = '#ff9800'; + } else { + params[`_color_${idx}`] = plot.color || getDefaultColor(activeIndicators.length + idx); + } }); metadata.inputs.forEach(input => { params[input.name] = input.default;