mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
- fixed touch swipe detection
- removed unnecessary hideswipebuttons calls - restyled swipe buttons to display flex
This commit is contained in:
@ -2709,7 +2709,7 @@ function showSwipeButtons() {
|
||||
if (swipeId !== undefined && swipeId != 0) {
|
||||
currentMessage.children('.swipe_left').css('display', 'flex');
|
||||
}
|
||||
if (is_send_press === false || chat[chat.length - 1].swipes.length > swipeId) { //only show right when generate is off, or when next right swipe would not make a generate happen
|
||||
if (is_send_press === false || chat[chat.length - 1].swipes.length >= swipeId) { //only show right when generate is off, or when next right swipe would not make a generate happen
|
||||
currentMessage.children('.swipe_right').css('display', 'flex');
|
||||
currentMessage.children('.swipe_right').css('opacity', '0.3');
|
||||
}
|
||||
@ -3024,7 +3024,7 @@ $(document).ready(function () {
|
||||
});
|
||||
$("#send_but").click(function () {
|
||||
if (is_send_press == false) {
|
||||
hideSwipeButtons();
|
||||
//hideSwipeButtons();
|
||||
is_send_press = true;
|
||||
|
||||
Generate();
|
||||
@ -3040,7 +3040,7 @@ $(document).ready(function () {
|
||||
|
||||
$("#send_textarea").keydown(function (e) {
|
||||
if (!e.shiftKey && !e.ctrlKey && e.key == "Enter" && is_send_press == false) {
|
||||
hideSwipeButtons();
|
||||
//hideSwipeButtons();
|
||||
is_send_press = true;
|
||||
e.preventDefault();
|
||||
Generate();
|
||||
@ -3667,7 +3667,7 @@ $(document).ready(function () {
|
||||
|
||||
else if (id == "option_regenerate") {
|
||||
if (is_send_press == false) {
|
||||
hideSwipeButtons();
|
||||
//hideSwipeButtons();
|
||||
is_send_press = true;
|
||||
Generate("regenerate");
|
||||
}
|
||||
|
@ -279,7 +279,8 @@ $("document").ready(function () {
|
||||
var SwipeButR = $('.swipe_right:last');
|
||||
var SwipeTargetMesClassParent = e.target.closest('.last_mes');
|
||||
if (SwipeTargetMesClassParent !== null) {
|
||||
if (SwipeButR.attr('style') == 'display: flex;' == true) {
|
||||
if (SwipeButR.css('display') === 'flex') {
|
||||
//if (SwipeButR.attr('style') == 'display: flex;' == true) {
|
||||
SwipeButR.click();
|
||||
}
|
||||
}
|
||||
@ -287,8 +288,10 @@ $("document").ready(function () {
|
||||
document.addEventListener('swiped-right', function (e) {
|
||||
var SwipeButL = $('.swipe_left:last');
|
||||
var SwipeTargetMesClassParent = e.target.closest('.last_mes');
|
||||
//console.log('Touch swipe check -- closest last_mes = "' + (SwipeTargetMesClassParent !== null) + ' Button display = ' + (SwipeButL.attr('style') == 'display: flex;' == true));
|
||||
if (SwipeTargetMesClassParent !== null) {
|
||||
if (SwipeButL.attr('style') == 'display: flex;' == true) {
|
||||
if (SwipeButL.css('display') === 'flex') {
|
||||
//if (SwipeButL.attr('style') == 'display: flex;' == true) {
|
||||
SwipeButL.click();
|
||||
}
|
||||
}
|
||||
|
@ -363,34 +363,33 @@ code {
|
||||
/* SWIPE RELATED STYLES*/
|
||||
|
||||
.swipe_right,.swipe_left {
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
opacity: 0.36;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
margin-top: 62px;
|
||||
margin-top: 60px;
|
||||
left: auto;
|
||||
background-color: var(--black50a);
|
||||
padding: 20px;
|
||||
border-radius: 50%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* display: none; */
|
||||
border: 1px solid grey;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.swipe_right img, .swipe_left img {
|
||||
height: 30px;
|
||||
display: flex;
|
||||
width: 30px;
|
||||
}
|
||||
.swipes-counter{
|
||||
display: inline;
|
||||
height: 15px;
|
||||
width: 30px;
|
||||
color: white;
|
||||
position: fixed;
|
||||
border: 1px solid red;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
color: white;
|
||||
position: fixed;
|
||||
font-size: 12px;
|
||||
padding: 0;
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
||||
.swipe_left {
|
||||
@ -2631,7 +2630,9 @@ a {
|
||||
min-width: 33%;
|
||||
}
|
||||
/*for debug purposes*/
|
||||
/** {border: 1px solid purple;}*/
|
||||
/*
|
||||
* {border: 1px solid purple;}
|
||||
*/
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
Reference in New Issue
Block a user