insert descriptive commit here

This commit is contained in:
nebula 2025-04-02 03:02:38 +00:00
parent 35f4176375
commit 02e6b30a1f

View File

@ -5,11 +5,14 @@ galleryImage = document.getElementById("galleryImage");
previewLinks = document.getElementsByClassName("previewLink"); previewLinks = document.getElementsByClassName("previewLink");
headerImage = document.getElementById("headerImage"); headerImage = document.getElementById("headerImage");
touchDragStartX = null;
touchDragThreshold = 50; touchDragThreshold = 50;
touchDirection = null;
directionDetermined = false; directionDetermined = false;
// null is used when no information is supposed to be available.
// functions set these to useful values during touch events.
touchDragStartX = null;
touchDirection = null;
function enlargeImage (filename) { function enlargeImage (filename) {
viewState = photos.indexOf(filename); viewState = photos.indexOf(filename);
galleryImage.fullRes = filename; galleryImage.fullRes = filename;
@ -72,6 +75,7 @@ function mouseUpHandler (event) {
}; };
function onTouchMove (event) { function onTouchMove (event) {
event.preventDefault();
screenX = event.changedTouches[0].screenX; screenX = event.changedTouches[0].screenX;
if (!directionDetermined && touchDragStartX == null) { if (!directionDetermined && touchDragStartX == null) {
touchDragStartX = screenX; touchDragStartX = screenX;
@ -85,6 +89,7 @@ function onTouchMove (event) {
}; };
function onTouchEnd (event) { function onTouchEnd (event) {
event.preventDefault();
// poorly phrased, but this must reset state to default // poorly phrased, but this must reset state to default
directionDetermined = false; directionDetermined = false;
touchDragStartX = null; touchDragStartX = null;