| 7493 | 7493 | const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`); |
| 7494 | 7494 | const swipeId = chat[chat.length - 1].swipe_id; |
| 7495 | 7495 | const swipeCounterText = (`${(swipeId + 1)}\u200B/\u200b${(chat[chat.length - 1].swipes.length)}`); |
| 7496 | + const swipeRight = currentMessage.find('.swipe_right'); |
| 7497 | + const swipeLeft = currentMessage.find('.swipe_left'); |
| 7498 | + const swipeCounter = currentMessage.find('.swipes-counter'); |
| 7496 | 7499 | |
| 7497 | 7500 | if (swipeId !== undefined && (chat[chat.length - 1].swipes.length > 1 || swipeId > 0)) { |
| 7498 | 7501 | currentMessage.children('.swipe_left')swipeLeft.css('display', 'flex'); |
| 7499 | 7502 | } |
| 7500 | 7503 | //only show right when generate is off, or when next right swipe would not make a generate happen |
| 7501 | 7504 | if (is_send_press === false || chat[chat.length - 1].swipes.length >= swipeId) { |
| 7502 | 7505 | // console.error('showingSwipeButtons: showing.'); |
| 7503 | 7506 | currentMessageswipeRight.findcss('.swipe_rightdisplay', 'flex').css('displayopacity', 'flex0.3'); |
| 7504 | 7507 | currentMessage.find('.swipe_right')swipeCounter.css('opacity', '0.3'); |
| 7505 | 7508 | } |
| 7506 | 7509 | //console.log((chat[chat.length - 1])); |
| 7507 | 7510 | if ((chat[chat.length - 1].swipes.length - swipeId) === 1) { |
| 7508 | 7511 | // console.error('highlighting R swipe'); |
| 7509 | 7512 | |
| 7510 | 7513 | //chevron was moved out of hardcode in HTML to class toggle dependent on last_mes or not |
| 7511 | 7514 | //necessary for 'swipe_right' div in past messages to have no chevron if 'show swipes for all messages' is turned on |
| 7512 | 7515 | currentMessage.find('.swipe_right')swipeRight.css('opacity', '0.7'); |
| 7516 | + swipeCounter.css('opacity', '0.7'); |
| 7513 | 7517 | } |
| 7514 | 7518 | //console.log(swipesCounterHTML); |
| 7515 | 7519 | |
| 7516 | 7520 | //allows for writing individual swipe counters for past messages |
| 7517 | 7521 | const lastSwipeCounter = $('.last_mes .swipes-counter').text(swipeCounterText); |
| 7518 | 7522 | $('.last_mes lastSwipeCounter.swipes-counter'text(swipeCounterText).show(); |
| 7519 | 7523 | |
| 7520 | 7524 | //console.log(swipeId); |
| 7521 | 7525 | //console.log(chat[chat.length - 1].swipes.length); |