Avoid selector parsing for drag paths
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user