Skip to content

Commit 3e4a306

Browse files
committed
Fix insert folder box drawing
1 parent 789c634 commit 3e4a306

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

frontend/src/components/panels/Layers.svelte

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
insertDepth: number;
3737
insertIndex: number | undefined;
3838
highlightFolder: boolean;
39+
highlightFolderIndex: number | undefined;
3940
markerHeight: number;
4041
};
4142
@@ -279,6 +280,7 @@
279280
280281
// Whether you are inserting into a folder and should show the folder outline
281282
let highlightFolder = false;
283+
let highlightFolderIndex: number | undefined = undefined;
282284
283285
let markerHeight = 0;
284286
const layerPanel = document.querySelector("[data-layer-panel]"); // Selects the element with the data-layer-panel attribute
@@ -305,6 +307,7 @@
305307
insertDepth = listing.depth;
306308
insertIndex = 0;
307309
highlightFolder = true;
310+
highlightFolderIndex = parseInt(indexAttribute, 10);
308311
} else {
309312
insertParentId = listing.parentId;
310313
insertDepth = listing.depth - 1;
@@ -342,6 +345,7 @@
342345
insertDepth,
343346
insertIndex,
344347
highlightFolder,
348+
highlightFolderIndex,
345349
markerHeight,
346350
};
347351
}
@@ -582,7 +586,7 @@
582586
"ancestor-of-selected": listing.ancestorOfSelected,
583587
"descendant-of-selected": listing.entry.descendantOfSelected,
584588
"selected-but-not-in-selected-network": selected && !listing.entry.inSelectedNetwork,
585-
"insert-folder": (draggingData?.highlightFolder || false) && draggingData?.insertParentId === listing.entry.id,
589+
"insert-folder": (draggingData?.highlightFolder || false) && draggingData?.highlightFolderIndex === index,
586590
}}
587591
styles={{ "--layer-indent-levels": `${listing.depth - 1}` }}
588592
data-layer
@@ -760,9 +764,13 @@
760764
background: rgba(var(--color-4-dimgray-rgb), 0.5);
761765
}
762766
763-
&.insert-folder {
764-
outline: 3px solid var(--color-e-nearwhite);
765-
outline-offset: -3px;
767+
&.insert-folder::after {
768+
content: "";
769+
position: absolute;
770+
inset: 0;
771+
border: 3px solid var(--color-e-nearwhite);
772+
border-radius: 2px;
773+
pointer-events: none;
766774
}
767775
768776
.expand-arrow {

0 commit comments

Comments
 (0)