From 7af922729eb9eee5395c2b99576cde9d3c58f8bd Mon Sep 17 00:00:00 2001 From: fractal-solutions Date: Tue, 19 Nov 2024 13:26:55 +0300 Subject: [PATCH] modified: index.html modified: main.js --- index.html | 31 +------------------------------ main.js | 14 ++++---------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/index.html b/index.html index c04c1e6..9c5d733 100644 --- a/index.html +++ b/index.html @@ -487,8 +487,8 @@ position: relative; margin-top: 5px; margin-bottom: 15px; - cursor: pointer; padding-top: 15px; + cursor: pointer; user-select: none; } @@ -513,35 +513,6 @@ background: var(--accent-purple); } - .portfolio { - padding-bottom: env(safe-area-inset-bottom, 20px); - } - - .stock-container { - padding: 15px; - } - - .stock-header { - flex-direction: column; - gap: 10px; - } - - .stock-info { - flex-wrap: wrap; - justify-content: space-between; - } - - .trade-buttons { - width: 100%; - justify-content: space-between; - } - - .btn { - flex: 1; - margin: 0 5px; - } - - /* Optional: Add overlay when panel is expanded */ .overlay { display: none; position: fixed; diff --git a/main.js b/main.js index dfbd15a..d0b1fea 100644 --- a/main.js +++ b/main.js @@ -456,18 +456,16 @@ initializeThemeSelector(); function initializeMobileAccountPanel() { const accountPanel = document.getElementById('account-panel'); + const header = accountPanel.querySelector('h3'); function handlePanelClick(e) { - // Only toggle if clicking the header area or drag handle - const header = accountPanel.querySelector('h3'); if (e.target === header || e.target.closest('h3')) { accountPanel.classList.toggle('collapsed'); - e.stopPropagation(); // Prevent body click handler from firing + e.stopPropagation(); } } function handleOutsideClick(e) { - // If panel is expanded and click is outside panel if (!accountPanel.classList.contains('collapsed') && !accountPanel.contains(e.target)) { accountPanel.classList.add('collapsed'); @@ -475,12 +473,8 @@ function initializeMobileAccountPanel() { } if (window.innerWidth <= 768) { - // Remove previous listeners if any - accountPanel.removeEventListener('touchstart', handlePanelClick); - document.body.removeEventListener('click', handleOutsideClick); - // Add click handlers - accountPanel.querySelector('h3').addEventListener('click', handlePanelClick); + header.addEventListener('click', handlePanelClick); document.body.addEventListener('click', handleOutsideClick); // Initialize in expanded state @@ -488,7 +482,7 @@ function initializeMobileAccountPanel() { } else { // Remove mobile-specific classes and listeners for desktop accountPanel.classList.remove('collapsed'); - accountPanel.querySelector('h3').removeEventListener('click', handlePanelClick); + header.removeEventListener('click', handlePanelClick); document.body.removeEventListener('click', handleOutsideClick); } }