tangled
alpha
login
or
join now
retr0.id
/
pdsls
forked from
pds.ls/pdsls
1
fork
atom
atproto explorer
1
fork
atom
overview
issues
pulls
pipelines
fix drag
handle.invalid
4 months ago
8553732b
fe40fb8b
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+2
-5
1 changed file
expand all
collapse all
unified
split
src
components
create.tsx
+2
-5
src/components/create.tsx
···
151
};
152
153
const dragBox = (box: HTMLDivElement) => {
154
-
let currentBox: HTMLDivElement | null = null;
155
let isDragging = false;
156
let offsetX: number;
157
let offsetY: number;
···
171
e.preventDefault();
172
isDragging = true;
173
box.classList.add("cursor-grabbing");
174
-
currentBox = box;
175
176
const rect = box.getBoundingClientRect();
177
···
185
};
186
187
const handleMouseMove = (e: MouseEvent) => {
188
-
if (isDragging && box === currentBox) {
189
let newLeft = e.clientX - offsetX;
190
let newTop = e.clientY - offsetY;
191
···
204
};
205
206
const handleMouseUp = () => {
207
-
if (isDragging && box === currentBox) {
208
isDragging = false;
209
box.classList.remove("cursor-grabbing");
210
-
currentBox = null;
211
}
212
};
213
···
151
};
152
153
const dragBox = (box: HTMLDivElement) => {
0
154
let isDragging = false;
155
let offsetX: number;
156
let offsetY: number;
···
170
e.preventDefault();
171
isDragging = true;
172
box.classList.add("cursor-grabbing");
0
173
174
const rect = box.getBoundingClientRect();
175
···
183
};
184
185
const handleMouseMove = (e: MouseEvent) => {
186
+
if (isDragging) {
187
let newLeft = e.clientX - offsetX;
188
let newTop = e.clientY - offsetY;
189
···
202
};
203
204
const handleMouseUp = () => {
205
+
if (isDragging) {
206
isDragging = false;
207
box.classList.remove("cursor-grabbing");
0
208
}
209
};
210