Files
btc-trading/src/api/dashboard/static/js/ui/sidebar.js
DiTus 258ac8eef2 Fix dashboard loading and maximize chart area
- Fixed TA panel loading state - now waits for initial data before loading technical analysis
- Changed initial loading message from 'Loading technical analysis...' to 'Waiting for candle data...'
- Made strategy simulation sidebar collapsed by default to maximize chart area
- Added refresh timestamp to TA panel when manually refreshed
- Improved error messages for when data isn't available in database
2026-02-25 22:16:12 +01:00

25 lines
915 B
JavaScript

export function toggleSidebar() {
const sidebar = document.getElementById('rightSidebar');
sidebar.classList.toggle('collapsed');
localStorage.setItem('sidebar_collapsed', sidebar.classList.contains('collapsed'));
// Resize chart after sidebar toggle
setTimeout(() => {
if (window.dashboard && window.dashboard.chart) {
const container = document.getElementById('chart');
window.dashboard.chart.applyOptions({
width: container.clientWidth,
height: container.clientHeight
});
}
}, 350); // Wait for CSS transition
}
export function restoreSidebarState() {
const collapsed = localStorage.getItem('sidebar_collapsed') !== 'false'; // Default to collapsed
const sidebar = document.getElementById('rightSidebar');
if (collapsed && sidebar) {
sidebar.classList.add('collapsed');
}
}