@@ 33,7 33,9 @@
pos2 = parseInt(window.localStorage.getItem(`pop-${id}left`));
// Correct illegally placed draggables
[pos1, pos2] = dragBoundsEnforce();
// Disabled until I can find a nice way to run this after the dynamic
// content injection by svelte
//[pos1, pos2] = dragBoundsEnforce();
// I hate JS for letting me pull crap like this
popup.style.top = `${pos1}px`;
@@ 65,8 67,6 @@
let [left, top, bounds_violated] = dragBoundsEnforce();
console.log(left, top, bounds_violated);
popup.style.left = left + "px";
popup.style.top = top + "px";
}
@@ 77,6 77,9 @@
let popup_dimensions = popup.getBoundingClientRect();
// This was originally meant to specify the amount of error acceptable
// before snapping to an edge or corner, but now it seems to merely adjust
// the amount of pixels between the screen edge and the bounds.
let snap_distance = 16;
let bounds = {
top: 8 + snap_distance,