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:
parent
31077629f1
commit
54eec3e215
|
@ -5950,7 +5950,7 @@
|
|||
<div class="zoomed_avatar_container">
|
||||
<div class="panelControlBar flex-container">
|
||||
<div class="fa-fw fa-solid fa-grip drag-grabber"></div>
|
||||
<div class="fa-fw fa-solid fa-circle-xmark dragClose"></div>
|
||||
<div class="fa-fw fa-solid fa-circle-xmark dragClose" id="closeZoom"></div>
|
||||
</div>
|
||||
<img class="zoomed_avatar_img" src=""
|
||||
data-izoomify-url=""
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue