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) { diff --git a/public/style.css b/public/style.css index d29c1208c..4fce5e225 100644 --- a/public/style.css +++ b/public/style.css @@ -3593,3 +3593,19 @@ a { 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; + } +}