Skip to content

Commit c9cf79a

Browse files
committed
fix offset values when dragging
1 parent cfc913a commit c9cf79a

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

client/admin/FolderAdmin.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,16 @@ export default function FolderAdmin() {
8686
offsetX = (firstDraggedElement.getBoundingClientRect().left - activeDraggedElement.getBoundingClientRect().left) * zoomWhenDragging;
8787
offsetY = (firstDraggedElement.getBoundingClientRect().top - activeDraggedElement.getBoundingClientRect().top) * zoomWhenDragging;
8888
}
89-
} else if (activeDraggedElement && ['tiles', 'mosaic'].includes(layout)) {
90-
offsetX = -15;
91-
offsetY = -15;
89+
} else if (activeDraggedElement) {
90+
if (layout === 'tiles') {
91+
if (activeDraggedElement.querySelector('figure img')?.getAttribute('src').endsWith('svg')) {
92+
offsetX = offsetY = -30;
93+
} else {
94+
offsetX = offsetY = -20;
95+
}
96+
} else if (layout === 'mosaic') {
97+
offsetX = offsetY = -23;
98+
}
9299
}
93100
}
94101

client/scss/finder-admin.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ ul.messagelist {
313313
align-content: flex-start;
314314
justify-content: flex-start;
315315

316-
li .inode {
316+
> li .inode {
317317
box-sizing: border-box;
318318

319319
div:has(> .figure-labels) {
@@ -342,18 +342,13 @@ ul.messagelist {
342342
&:not([src$=".svg"]) {
343343
box-shadow: $border-color 0 0 5px;
344344
}
345-
346-
&[src$=".svg"] {
347-
transform: scale(85%);
348-
}
349345
}
350346
video {
351347
border-radius: 5px;
352348
box-shadow: $border-color 0 0 5px;
353349
}
354350

355351
figcaption {
356-
margin-top: 0.25rem;
357352
text-align: center;
358353
width: 100%;
359354
word-break: break-all;
@@ -370,12 +365,17 @@ ul.messagelist {
370365
gap: 5px;
371366

372367
li:not(.status) {
373-
min-height: 250px;
374-
width: 190px;
368+
min-height: 248px;
369+
width: 192px;
370+
box-sizing: border-box;
375371
cursor: pointer;
376372
font-size: 15px;
377373
line-height: 18px;
378374

375+
&:has(figure img[src$=".svg"]) {
376+
padding: 15px; // this reduced the size of SVG images
377+
}
378+
379379
.inode .figure-labels {
380380
inset: 5px;
381381

0 commit comments

Comments
 (0)