feat: highlight selected node

This commit is contained in:
2025-09-16 14:44:55 +02:00
parent 27f93959ff
commit 13f771837b
4 changed files with 102 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ class DrawerComponent {
this.detailsDrawerContent = null;
this.detailsDrawerBackdrop = null;
this.activeDrawerComponent = null;
this.onCloseCallback = null;
}
// Determine if we should use desktop drawer behavior
@@ -57,8 +58,9 @@ class DrawerComponent {
});
}
openDrawer(title, contentCallback, errorCallback) {
openDrawer(title, contentCallback, errorCallback, onCloseCallback) {
this.ensureDrawer();
this.onCloseCallback = onCloseCallback;
// Set drawer title
const titleEl = this.detailsDrawer.querySelector('.drawer-title');
@@ -101,6 +103,12 @@ class DrawerComponent {
closeDrawer() {
if (this.detailsDrawer) this.detailsDrawer.classList.remove('open');
if (this.detailsDrawerBackdrop) this.detailsDrawerBackdrop.classList.remove('visible');
// Call close callback if provided
if (this.onCloseCallback) {
this.onCloseCallback();
this.onCloseCallback = null;
}
}
// Clean up drawer elements