Improve gallery layout Closes #2907

061ed1db65dca2a6fc3b6a127a72c0bdb41b1aa7

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +5 -12Ignore whitespace
public/scripts/extensions/gallery/index.js+5 -5
@@ -26,9 +26,9 @@ let paginationVisiblePages = 10;
26let paginationMaxLinesPerPage = 2;26let paginationMaxLinesPerPage = 2;
27let galleryMaxRows = 3;27let galleryMaxRows = 3;
2828
29$('body').on('click', '.dragClose', function () {29$('#movingDivs').on('click', '.dragClose', function () {
30 const relatedId = $(this).data('related-id'); // Get the ID of the related draggable30 const relatedId = $(this).data('related-id'); // Get the ID of the related draggable
31 $(`body > .draggable[id="${relatedId}"]`).remove(); // Remove the associated draggable31 $(`#movingDivs > .draggable[id="${relatedId}"]`).remove(); // Remove the associated draggable
32});32});
3333
34const CUSTOM_GALLERY_REMOVED_EVENT = 'galleryRemoved';34const CUSTOM_GALLERY_REMOVED_EVENT = 'galleryRemoved';
@@ -290,7 +290,7 @@ function makeMovable(id = 'gallery') {
290290
291 $('#dragGallery').css('display', 'block');291 $('#dragGallery').css('display', 'block');
292292
293 $('body').append(newElement);293 $('#movingDivs').append(newElement);
294294
295 loadMovingUIState();295 loadMovingUIState();
296 $(`.draggable[forChar="${id}"]`).css('display', 'block');296 $(`.draggable[forChar="${id}"]`).css('display', 'block');
@@ -362,8 +362,8 @@ function makeDragImg(id, url) {
362 }362 }
363 }363 }
364364
365 // Step 3: Attach it to the body365 // Step 3: Attach it to the movingDivs container
366 document.body.appendChild(newElement);366 document.getElementById('movingDivs').appendChild(newElement);
367367
368 // Step 4: Call dragElement and loadMovingUIState368 // Step 4: Call dragElement and loadMovingUIState
369 const appendedElement = document.getElementById(uniqueId);369 const appendedElement = document.getElementById(uniqueId);
public/style.css+0 -7
@@ -5386,13 +5386,6 @@ body:not(.movingUI) .drawer-content.maximized {
53865386
5387/* Jank mobile support for gallery and future draggables */5387/* Jank mobile support for gallery and future draggables */
5388@media screen and (max-width: 1000px) {5388@media screen and (max-width: 1000px) {
5389 #gallery {
5390 display: block;
5391 width: 100vw;
5392 height: 100vh;
5393 z-index: 9999;
5394 }
5395
5396 .draggable {5389 .draggable {
5397 display: block;5390 display: block;
5398 width: 100vw;5391 width: 100vw;