From b7cce1a0dcae18b3b8e4ed3bb06db43b5b71180d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Saquetim?= Date: Mon, 5 Aug 2024 22:28:38 -0300 Subject: [PATCH] DEV: Auto expand active sections and scroll active link into view --- .../app/components/sidebar/api-panels.gjs | 6 ++- .../app/components/sidebar/api-section.gjs | 10 +++- .../app/components/sidebar/api-sections.gjs | 52 +++++++++++++++++-- .../app/components/sidebar/section-link.gjs | 25 +++++++++ .../app/components/sidebar/section.gjs | 39 ++++++++++++++ .../lib/sidebar/base-custom-sidebar-panel.js | 8 +++ .../base-custom-sidebar-section-link.js | 5 ++ 7 files changed, 140 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/sidebar/api-panels.gjs b/app/assets/javascripts/discourse/app/components/sidebar/api-panels.gjs index 61562707abb..8f1059002e7 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/api-panels.gjs +++ b/app/assets/javascripts/discourse/app/components/sidebar/api-panels.gjs @@ -11,7 +11,11 @@ export default class SidebarApiPanels extends Component { } diff --git a/app/assets/javascripts/discourse/app/components/sidebar/api-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/api-section.gjs index 3cc7fa9a059..2b5d117cd5d 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/api-section.gjs +++ b/app/assets/javascripts/discourse/app/components/sidebar/api-section.gjs @@ -1,3 +1,4 @@ +import { and, eq } from "truth-helpers"; import Section from "./section"; import SectionLink from "./section-link"; @@ -14,6 +15,9 @@ const SidebarApiSection =