diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-08-24 20:58:12 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-08-24 20:58:12 -0400 |
commit | 5d05fb3e674953efe2f68c7e8b6d0901ad05f831 (patch) | |
tree | 09e3cdd00ccb6d0b3c0791f43561e0b9a1190598 /public/js/app.js | |
parent | 693580a13cc074131f5dbcf8998f9bbf7d7a99f4 (diff) | |
download | thedroneely.com-5d05fb3e674953efe2f68c7e8b6d0901ad05f831.tar.gz thedroneely.com-5d05fb3e674953efe2f68c7e8b6d0901ad05f831.tar.bz2 thedroneely.com-5d05fb3e674953efe2f68c7e8b6d0901ad05f831.zip |
public/js/app: Handle touch event for closing on zoom overlay
Diffstat (limited to 'public/js/app.js')
-rw-r--r-- | public/js/app.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/public/js/app.js b/public/js/app.js index f3fa6bc..7a96e7c 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -216,6 +216,13 @@ window.onscroll = function() { target: target }); }; + var _handleTouch = function _handleTouch(event) { + var target = event.target; + if (target === overlay) { + close(); + return; + } + }; var _handleScroll = function _handleScroll() { if (isAnimating || !active.original) { return; @@ -546,6 +553,7 @@ window.onscroll = function() { }, zoomOptions); var overlay = createOverlay(zoomOptions.background); document.addEventListener("click", _handleClick); + document.addEventListener("touchstart", _handleTouch); document.addEventListener("keyup", _handleKeyUp); document.addEventListener("scroll", _handleScroll); window.addEventListener("resize", close); |