From ab440a3d7b94405f423776ec8786c643fb2f9136 Mon Sep 17 00:00:00 2001 From: city-unit <140349364+city-unit@users.noreply.github.com> Date: Wed, 30 Aug 2023 22:54:34 -0400 Subject: [PATCH 1/2] Uhh, mobile support --- public/style.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public/style.css b/public/style.css index 9f750d875..f04607ffc 100644 --- a/public/style.css +++ b/public/style.css @@ -3584,4 +3584,20 @@ a { width: 100%; height: 100%; object-fit: cover; +} + +/* 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; + height: 100vh; + z-index: 9999; + } } \ No newline at end of file From 08e1b5bb5ed7baf320e7e1ae162aed83abd83599 Mon Sep 17 00:00:00 2001 From: city-unit <140349364+city-unit@users.noreply.github.com> Date: Sat, 2 Sep 2023 15:40:15 -0400 Subject: [PATCH 2/2] Fix dropzone issue and resize issue --- public/scripts/RossAscends-mods.js | 6 ++++++ public/scripts/extensions/gallery/index.js | 14 ++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 4a9e54ee3..cb56694ee 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -557,6 +557,12 @@ export function dragElement(elmnt) { //set a listener for mouseup to save new width/height elmnt.off('mouseup').on('mouseup', () => { console.debug(`Saving ${elmntName} Height/Width`) + // check if the height or width actually changed + if (power_user.movingUIState[elmntName].width === width && power_user.movingUIState[elmntName].height === height) { + console.debug('no change detected, aborting save') + return + } + power_user.movingUIState[elmntName].width = width; power_user.movingUIState[elmntName].height = height; eventSource.emit('resizeUI', elmntName); diff --git a/public/scripts/extensions/gallery/index.js b/public/scripts/extensions/gallery/index.js index 39fc982ef..4bdde9453 100644 --- a/public/scripts/extensions/gallery/index.js +++ b/public/scripts/extensions/gallery/index.js @@ -75,20 +75,8 @@ async function initGallery(items, url) { fnThumbnailOpen: viewWithDragbox, }); - $(document).ready(function () { - $('.nGY2GThumbnailImage').on('click', function () { - let imageUrl = $(this).find('.nGY2GThumbnailImg').attr('src'); - // Do what you want with the imageUrl, for example: - // Display it in a full-size view or replace the gallery grid content with this image - console.log(imageUrl); - }); - }); eventSource.on('resizeUI', function (elmntName) { - console.log('resizeUI saw', elmntName); - // Your logic here - - // If you want to resize the nanogallery2 instance when this event is triggered: jQuery("#dragGallery").nanogallery2('resize'); }); @@ -98,6 +86,8 @@ async function initGallery(items, url) { dropZone.off('dragleave'); dropZone.off('drop'); + // Set dropzone height to be the same as the parent + dropZone.css('height', dropZone.parent().css('height')); // Initialize dropzone handlers dropZone.on('dragover', function (e) {