Improve gallery layout

Closes #2907
This commit is contained in:
Cohee
2024-09-27 08:02:08 +00:00
parent 735fe49a84
commit 061ed1db65
2 changed files with 5 additions and 12 deletions

View File

@ -26,9 +26,9 @@ let paginationVisiblePages = 10;
let paginationMaxLinesPerPage = 2;
let galleryMaxRows = 3;
$('body').on('click', '.dragClose', function () {
$('#movingDivs').on('click', '.dragClose', function () {
const relatedId = $(this).data('related-id'); // Get the ID of the related draggable
$(`body > .draggable[id="${relatedId}"]`).remove(); // Remove the associated draggable
$(`#movingDivs > .draggable[id="${relatedId}"]`).remove(); // Remove the associated draggable
});
const CUSTOM_GALLERY_REMOVED_EVENT = 'galleryRemoved';
@ -290,7 +290,7 @@ function makeMovable(id = 'gallery') {
$('#dragGallery').css('display', 'block');
$('body').append(newElement);
$('#movingDivs').append(newElement);
loadMovingUIState();
$(`.draggable[forChar="${id}"]`).css('display', 'block');
@ -362,8 +362,8 @@ function makeDragImg(id, url) {
}
}
// Step 3: Attach it to the body
document.body.appendChild(newElement);
// Step 3: Attach it to the movingDivs container
document.getElementById('movingDivs').appendChild(newElement);
// Step 4: Call dragElement and loadMovingUIState
const appendedElement = document.getElementById(uniqueId);