From 4603384af0f9053c40115eb5c236d8857357f8cd Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 1 Sep 2015 00:55:09 -0500 Subject: fix altclick --- cgi-bin/details | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cgi-bin/details b/cgi-bin/details index dc245cf..87c8677 100755 --- a/cgi-bin/details +++ b/cgi-bin/details @@ -204,7 +204,11 @@ Array.prototype.slice.apply(links).forEach(function(url){ if (! url.href.match(/(mp3|wav|ogg)/)) return var index = music.length music.push(url) - url.addEventListener("click", function(e){ e.preventDefault(); play(index) }) + url.addEventListener("click", function(e){ + if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return + e.preventDefault() + play(index) + }) }) if (music.length) { audio = document.createElement("audio") @@ -236,7 +240,7 @@ function toggle(){ else audio.pause() } function keydown(e){ - if (typing) return + if (typing || e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return switch (e.keyCode) { case 37: // left prev() -- cgit v1.2.3-70-g09d2