From 3fbf9ecf50ad1d01b7865ea4e4cba61c85d7242c Mon Sep 17 00:00:00 2001 From: jianglinbin <313185710@qq.com> Date: Mon, 12 Jan 2026 07:50:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E4=BE=8B?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E8=A2=AB=E9=9A=90=E8=97=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/angles_selector.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/web/angles_selector.js b/web/angles_selector.js index 395dd3b..ce67d77 100644 --- a/web/angles_selector.js +++ b/web/angles_selector.js @@ -20,11 +20,13 @@ const STYLES = ` .control-btn.close-up { background: #FF6B6B; } .control-btn.medium { background: #FFD93D; color: #333; } .control-btn.wide { background: #6BCB77; } - .legend { display: flex; gap: 10px; margin-top: 6px; font-size: 10px; } - .legend-item { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 6px; border-radius: 3px; transition: opacity 0.2s; } + .bottom-controls { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; } + .legend { display: flex; gap: 8px; font-size: 10px; align-items: center; } + .legend-item { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 6px; border-radius: 3px; } .legend-item:hover { background: rgba(255,255,255,0.1); } - .legend-item.hidden { opacity: 0.4; text-decoration: line-through; } - .legend-dot { width: 8px; height: 8px; border-radius: 50%; } + .legend-item.layer-hidden { opacity: 0.4; } + .legend-item.layer-hidden span:last-child { text-decoration: line-through; } + .legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; } `; function getTemplate() { @@ -39,9 +41,9 @@ function getTemplate() {
-
${t('closeUp')}
-
${t('medium')}
-
${t('wide')}
+
${t('closeUp')}
+
${t('medium')}
+
${t('wide')}
`; } @@ -86,10 +88,11 @@ app.registerExtension({ // 图例点击切换层可见性 container.querySelectorAll('.legend-item').forEach(item => { - item.onclick = () => { + item.onclick = (e) => { + e.stopPropagation(); const layer = parseInt(item.dataset.layer); const visible = this.selector3D.toggleLayerVisibility(layer); - item.classList.toggle('hidden', !visible); + item.classList.toggle('layer-hidden', !visible); }; }); };