mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Quick fix for arrowkey swipe stuff
This commit is contained in:
@@ -949,8 +949,15 @@ export function initRossMods() {
|
|||||||
CheckLocal();
|
CheckLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function to check if nanogallery2's lightbox is active
|
||||||
|
function isNanogallery2LightboxActive() {
|
||||||
|
// Check if the body has the 'nGY2On' class, adjust this based on actual behavior
|
||||||
|
return $('body').hasClass('nGY2_body_scrollbar');
|
||||||
|
}
|
||||||
|
|
||||||
if (event.key == "ArrowLeft") { //swipes left
|
if (event.key == "ArrowLeft") { //swipes left
|
||||||
if (
|
if (
|
||||||
|
!isNanogallery2LightboxActive() && // Check if lightbox is NOT active
|
||||||
$(".swipe_left:last").css('display') === 'flex' &&
|
$(".swipe_left:last").css('display') === 'flex' &&
|
||||||
$("#send_textarea").val() === '' &&
|
$("#send_textarea").val() === '' &&
|
||||||
$("#character_popup").css("display") === "none" &&
|
$("#character_popup").css("display") === "none" &&
|
||||||
@@ -962,6 +969,7 @@ export function initRossMods() {
|
|||||||
}
|
}
|
||||||
if (event.key == "ArrowRight") { //swipes right
|
if (event.key == "ArrowRight") { //swipes right
|
||||||
if (
|
if (
|
||||||
|
!isNanogallery2LightboxActive() && // Check if lightbox is NOT active
|
||||||
$(".swipe_right:last").css('display') === 'flex' &&
|
$(".swipe_right:last").css('display') === 'flex' &&
|
||||||
$("#send_textarea").val() === '' &&
|
$("#send_textarea").val() === '' &&
|
||||||
$("#character_popup").css("display") === "none" &&
|
$("#character_popup").css("display") === "none" &&
|
||||||
@@ -972,6 +980,7 @@ export function initRossMods() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (event.ctrlKey && event.key == "ArrowUp") { //edits last USER message if chatbar is empty and focused
|
if (event.ctrlKey && event.key == "ArrowUp") { //edits last USER message if chatbar is empty and focused
|
||||||
if (
|
if (
|
||||||
$("#send_textarea").val() === '' &&
|
$("#send_textarea").val() === '' &&
|
||||||
|
Reference in New Issue
Block a user