Update the browser, editor, settings, and installer
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { isImagePath } from "../workspace/media";
|
||||
|
||||
type Point = { x: number; y: number };
|
||||
const targets = new Map<HTMLElement, (path: string, point: Point) => void>();
|
||||
let highlighted: HTMLElement | undefined;
|
||||
@@ -8,7 +6,7 @@ export function registerImageDropTarget(element: HTMLElement, drop: (path: strin
|
||||
return () => { targets.delete(element); element.classList.remove("image-drop-target"); };
|
||||
}
|
||||
function targetAt(path: string, point: Point) {
|
||||
if (!isImagePath(path)) return;
|
||||
if (!path || path.endsWith("/")) return;
|
||||
const hit = document.elementFromPoint(point.x, point.y);
|
||||
return [...targets].find(([element]) => element.isConnected && hit && element.contains(hit));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user