From 179a67e5faab60381660fbf94e44ce6b49e82826 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 21 Sep 2017 12:00:50 -0400 Subject: [PATCH] Prevent right click context menu Chrome (again) makes a context menu when a touch pointer is held. We'll have none of that --- script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script.js b/script.js index 3909f57..1ce1a92 100644 --- a/script.js +++ b/script.js @@ -15,6 +15,8 @@ window.addEventListener('load', () => { deckName = document.querySelector('#card-container').getAttribute("data-deckName"); xhr.open("GET", "/deck/" + deckName + "/deck.json"); xhr.send(); + + window.addEventListener("contextmenu", event => event.preventDefault()); }); let cardInteract = interact('.card', {ignoreFrom: '.in-list'})