diff --git a/public/scripts/extensions/gallery/index.js b/public/scripts/extensions/gallery/index.js index 2e2d51a31..d74935802 100644 --- a/public/scripts/extensions/gallery/index.js +++ b/public/scripts/extensions/gallery/index.js @@ -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); diff --git a/public/style.css b/public/style.css index 335bff05c..476765b07 100644 --- a/public/style.css +++ b/public/style.css @@ -5386,13 +5386,6 @@ body:not(.movingUI) .drawer-content.maximized { /* Jank mobile support for gallery and future draggables */ @media screen and (max-width: 1000px) { - #gallery { - display: block; - width: 100vw; - height: 100vh; - z-index: 9999; - } - .draggable { display: block; width: 100vw;