style: Reformat and comment

This commit is contained in:
sthag 2025-11-02 09:18:12 +01:00
parent 9d15f22f5d
commit abf393191c
3 changed files with 8 additions and 9 deletions

View file

@ -210,14 +210,12 @@ class DragAdv {
const rect = this.placeholder.getBoundingClientRect();
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const distances = {
left: rect.left,
right: windowWidth - rect.right,
top: rect.top,
bottom: windowHeight - rect.bottom
right: windowWidth - rect.right,
bottom: windowHeight - rect.bottom,
left: rect.left
};
const closestEdge = Object.keys(distances).reduce((a, b) => distances[a] < distances[b] ? a : b);
this.setPosition(closestEdge, this.barSize);