Avoid selector parsing for drag paths

This commit is contained in:
Mikei386
2026-06-23 06:45:08 +02:00
parent e0a61c074e
commit 11b76f4572
5 changed files with 7 additions and 12 deletions
+4 -9
View File
@@ -655,8 +655,10 @@ function findPointerDropTarget(event) {
}
function markDraggingRow(path, dragging) {
for (const row of workspace.querySelectorAll(`.file-row[data-path="${cssEscape(path)}"]`)) {
row.classList.toggle('dragging', dragging);
for (const row of workspace.querySelectorAll('.file-row')) {
if (row.dataset.path === path) {
row.classList.toggle('dragging', dragging);
}
}
}
@@ -792,13 +794,6 @@ function escapeAttr(value) {
return escapeHtml(value);
}
function cssEscape(value) {
if (window.CSS?.escape) {
return CSS.escape(String(value));
}
return String(value).replace(/["\\]/g, '\\$&');
}
function clamp(value, min, max) {
return Math.max(min, Math.min(max, value));
}