From 728a233842245a7f56d0bd9585bcda2a89615bb2 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 4 Sep 2024 04:45:40 +0200 Subject: [PATCH 1/2] Allow mobile swipes with open panels if focused - Allow mobile swipe gestures when sheld is focused, ignoring open panels or floating prompts present now - Fixes #2753 --- public/scripts/RossAscends-mods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 6805cbabf..a1152e4a3 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -905,7 +905,7 @@ export function initRossMods() { if (Popup.util.isPopupOpen()) { return; } - if ($('.mes_edit_buttons, .drawer-content, #character_popup, #dialogue_popup, #WorldInfo, #right-nav-panel, #left-nav-panel, #select_chat_popup, #floatingPrompt').is(':visible')) { + if (!$('#sheld').is(':focus-within')) { return; } var SwipeButR = $('.swipe_right:last'); @@ -923,7 +923,7 @@ export function initRossMods() { if (Popup.util.isPopupOpen()) { return; } - if ($('.mes_edit_buttons, .drawer-content, #character_popup, #dialogue_popup, #WorldInfo, #right-nav-panel, #left-nav-panel, #select_chat_popup, #floatingPrompt').is(':visible')) { + if (!$('#sheld').is(':focus-within')) { return; } var SwipeButL = $('.swipe_left:last'); From 88f741b301b1a0220eb025708a74827d6a7d740e Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 4 Sep 2024 21:17:07 +0200 Subject: [PATCH 2/2] Fix swipe gesture, using target --- public/scripts/RossAscends-mods.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index a1152e4a3..7a3f84a58 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -896,8 +896,7 @@ export function initRossMods() { restoreUserInput(); - //Regenerate if user swipes on the last mesage in chat - + // Swipe gestures (see: https://www.npmjs.com/package/swiped-events) document.addEventListener('swiped-left', function (e) { if (power_user.gestures === false) { return; @@ -905,7 +904,7 @@ export function initRossMods() { if (Popup.util.isPopupOpen()) { return; } - if (!$('#sheld').is(':focus-within')) { + if (!$(e.target).closest('#sheld').length) { return; } var SwipeButR = $('.swipe_right:last'); @@ -923,7 +922,7 @@ export function initRossMods() { if (Popup.util.isPopupOpen()) { return; } - if (!$('#sheld').is(':focus-within')) { + if (!$(e.target).closest('#sheld').length) { return; } var SwipeButL = $('.swipe_left:last');