@@ 5,7 5,7 @@
import ChevronUp from "../../icons/ChevronUp.svelte";
import Button from "./Button.svelte";
import createDebug from "debug";
let clazz = "";
export { clazz as class };
@@ 31,9 31,9 @@
if (draggable) {
pos1 = parseInt(window.localStorage.getItem(`pop-${id}top`));
pos2 = parseInt(window.localStorage.getItem(`pop-${id}left`));
// Correct illegally placed draggables
[pos1, pos2, ] = dragBoundsEnforce();
[pos1, pos2] = dragBoundsEnforce();
// I hate JS for letting me pull crap like this
popup.style.top = `${pos1}px`;
@@ 76,15 76,15 @@
let top = pos2;
let popup_dimensions = popup.getBoundingClientRect();
let snap_distance = 16;
let bounds = {
"top": 8 + snap_distance,
"left": 8 + snap_distance,
"bottom": window.innerHeight - popup_dimensions.height - 8 - snap_distance,
"right": window.innerWidth - popup_dimensions.width - 8 - snap_distance
}
top: 8 + snap_distance,
left: 8 + snap_distance,
bottom: window.innerHeight - popup_dimensions.height - 8 - snap_distance,
right: window.innerWidth - popup_dimensions.width - 8 - snap_distance,
};
let bounds_violated = false;
// Add cases for snapping here
@@ 4,47 4,45 @@
</script>
<svg
- width="1rem"
- height="1rem"
- viewBox="0 0 32 32"
- version="1.1"
- id="svg1"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:svg="http://www.w3.org/2000/svg">
- <defs
- id="defs1" />
- <g
- id="layer1">
+ width="1rem"
+ height="1rem"
+ viewBox="0 0 32 32"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs id="defs1" />
+ <g id="layer1">
<path
- id="rect1-5"
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- d="M 6,22 0,16 6,10 Z" />
+ id="rect1-5"
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ d="M 6,22 0,16 6,10 Z" />
<path
- id="rect1-5-6"
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- d="M 10,6 16,0 22,6 Z" />
+ id="rect1-5-6"
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ d="M 10,6 16,0 22,6 Z" />
<path
- id="rect1-5-61"
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- d="M 26,10 32,16 26,22 Z" />
+ id="rect1-5-61"
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ d="M 26,10 32,16 26,22 Z" />
<path
- id="rect1-5-2"
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- d="M 22,26 16,32 10,26 Z" />
+ id="rect1-5-2"
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ d="M 22,26 16,32 10,26 Z" />
<rect
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- id="rect1"
- width="4"
- height="24"
- x="14"
- y="4" />
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ id="rect1"
+ width="4"
+ height="24"
+ x="14"
+ y="4" />
<rect
- style="fill:#ffffff;fill-opacity:1;stroke-width:0"
- id="rect1-7"
- width="4"
- height="24"
- x="14"
- y="-28"
- transform="rotate(90)" />
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0"
+ id="rect1-7"
+ width="4"
+ height="24"
+ x="14"
+ y="-28"
+ transform="rotate(90)" />
</g>
</svg>