Fix swipe gesture, using target

This commit is contained in:
Wolfsblvt
2024-09-04 21:17:07 +02:00
parent 26635f9f10
commit 88f741b301

View File

@@ -896,8 +896,7 @@ export function initRossMods() {
restoreUserInput(); 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) { document.addEventListener('swiped-left', function (e) {
if (power_user.gestures === false) { if (power_user.gestures === false) {
return; return;
@@ -905,7 +904,7 @@ export function initRossMods() {
if (Popup.util.isPopupOpen()) { if (Popup.util.isPopupOpen()) {
return; return;
} }
if (!$('#sheld').is(':focus-within')) { if (!$(e.target).closest('#sheld').length) {
return; return;
} }
var SwipeButR = $('.swipe_right:last'); var SwipeButR = $('.swipe_right:last');
@@ -923,7 +922,7 @@ export function initRossMods() {
if (Popup.util.isPopupOpen()) { if (Popup.util.isPopupOpen()) {
return; return;
} }
if (!$('#sheld').is(':focus-within')) { if (!$(e.target).closest('#sheld').length) {
return; return;
} }
var SwipeButL = $('.swipe_left:last'); var SwipeButL = $('.swipe_left:last');