From dc2b7fc2017c3910b097a892cf86e968e547ed18 Mon Sep 17 00:00:00 2001 From: DiTus Date: Wed, 25 Feb 2026 23:15:47 +0100 Subject: [PATCH] Fix settings controls and prevent auto-expand 1. Removed configuringId setting from addIndicator so indicators are NOT expanded by default 2. Added window.updateIndicatorColor function to handle color picker changes 3. Added onchange handler to color picker input to call updateIndicatorColor 4. Added window.updateIndicatorSetting function to update indicator parameters Users can now: - Not have indicators auto-expanded when added (default collapsed) - Click indicator name to manually expand settings - Change colors and settings and they will update on the chart --- .../static/js/ui/indicators-panel-new.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/api/dashboard/static/js/ui/indicators-panel-new.js b/src/api/dashboard/static/js/ui/indicators-panel-new.js index 7d8dcc7..96d8405 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -270,15 +270,15 @@ function renderIndicatorConfig(indicator, meta) { ${plotGroups.map(group => { const firstIdx = group.indices[0]; const color = indicator.params[`_color_${firstIdx}`] || meta.plots[firstIdx]?.color || getDefaultColor(activeIndicators.indexOf(indicator)); - return ` +return `
- +
- `; + `.trim() + ''; }).join('')}
@@ -453,6 +453,22 @@ window.clearSearch = function() { renderIndicatorPanel(); }; +window.updateIndicatorColor = function(id, index, color) { + const indicator = activeIndicators.find(a => a.id === id); + if (!indicator) return; + + indicator.params[`_color_${index}`] = color; + drawIndicatorsOnChart(); +}; + +window.updateIndicatorSetting = function(id, key, value) { + const indicator = activeIndicators.find(a => a.id === id); + if (!indicator) return; + + indicator.params[key] = value; + drawIndicatorsOnChart(); +}; + window.clearAllIndicators = function() { activeIndicators.forEach(ind => { ind.series?.forEach(s => { @@ -607,8 +623,7 @@ function addIndicator(type) { series: [], visible: true }); - - configuringId = id; + // Don't set configuringId so indicators are NOT expanded by default renderIndicatorPanel(); drawIndicatorsOnChart(); };