mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Separate handling for closing for mobile and desktop
Clicking on the image only closes on desktop now, while on mobile the close button has to be pressed as touch is used for the magnification
This commit is contained in:
@ -10245,7 +10245,7 @@ jQuery(async function () {
|
||||
$(`.zoomed_avatar[forChar="${charname}"] .dragClose`).hide();
|
||||
}
|
||||
|
||||
$('.zoomed_avatar, .zoomed_avatar .dragClose').on('click touchend', (e) => {
|
||||
$('.zoomed_avatar').on('mouseup', (e) => {
|
||||
if (e.target.closest('.drag-grabber')) {
|
||||
return;
|
||||
}
|
||||
@ -10254,6 +10254,14 @@ jQuery(async function () {
|
||||
});
|
||||
});
|
||||
|
||||
$('.zoomed_avatar, .zoomed_avatar .dragClose').on('click touchend', (e) => {
|
||||
if (e.target.closest('.dragClose')) {
|
||||
$(`.zoomed_avatar[forChar="${charname}"]`).fadeOut(animation_duration, () => {
|
||||
$(`.zoomed_avatar[forChar="${charname}"]`).remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
zoomedAvatarImgElement.on('dragstart', (e) => {
|
||||
console.log('saw drag on avatar!');
|
||||
e.preventDefault();
|
||||
|
Reference in New Issue
Block a user