képnéző ne jelölődjön ki, sima kattintásra bezárul

This commit is contained in:
Kováts Levente 2021-01-24 12:15:49 +01:00
parent 402f21e5c6
commit 0ffaf09ae0

View File

@ -583,11 +583,13 @@ function init_viewer() {
change_viewer_magnification(-e.deltaY * magnification_sensitivity);
}, false);
// a képre kattintáskor ne záródjon be a nézegető
// a képre kattintáskor ne záródjon be a nézegető, ha éppen mozgatjuk
img.addEventListener("click", (e) => {
e.preventDefault();
e.stopPropagation();
return false;
if (e.clientX !== viewer_original_mouse_coords.x || e.clientY !== viewer_original_mouse_coords.y) {
e.preventDefault();
e.stopPropagation();
return false;
}
}, false);
// nézegető billentyű-kombinációk
@ -605,6 +607,11 @@ function init_viewer() {
viewer_original_mouse_coords = {x: e.clientX, y: e.clientY};
viewer_grabbing = true;
img.style.cursor = "grabbing";
// ne jelölődjön ki a kép
e.preventDefault();
e.stopPropagation();
return false;
}, false);
img.addEventListener("mousemove", (e) => {