From 3b0c15e6cad82906b5a35125d50997ee81291d81 Mon Sep 17 00:00:00 2001 From: Keplyx Date: Thu, 8 Nov 2018 14:19:21 +0100 Subject: [PATCH] Improved photos --- assets/scripts/photosScript.js | 7 ++++--- photos.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/scripts/photosScript.js b/assets/scripts/photosScript.js index 2dfc7b3..3c871c2 100755 --- a/assets/scripts/photosScript.js +++ b/assets/scripts/photosScript.js @@ -181,15 +181,16 @@ function timerIncrement() { * Control images with keyboard arrows */ $(document).keydown(function (e) { - switch (e.which) { + switch (e.keyCode) { case 37: // left displayNext(-1); break; - case 39: // right displayNext(1); break; - + case 27: + closeBig(); + break; default: return; // exit this handler for other keys } diff --git a/photos.php b/photos.php index 216d386..4f3ea09 100755 --- a/photos.php +++ b/photos.php @@ -192,7 +192,7 @@ function isValidImage($imagePath) */ function isValidDirectory($directoryPath, $directory) { - return is_dir($directoryPath) && $directory != "." && $directory != ".."; + return is_dir($directoryPath) && $directory != "." && $directory != ".." && substr($directory, 0, 1 ) !== "."; } @@ -265,7 +265,7 @@ function generatePath($path) Télécharger l'album photos