From 5fbd7a6a959619f811a564f24efb7fae8c0d76f3 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 10 Nov 2013 21:34:03 -0800 Subject: [PATCH] treat controls as links when clicked with modifier keys --- playersettings.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/playersettings.js b/playersettings.js index 66a023a0..26242586 100644 --- a/playersettings.js +++ b/playersettings.js @@ -6,13 +6,15 @@ if (window.addEventListener) window.addEventListener("load", function(e) { var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")]; function setupLoopLink(i) { loopLinks[i].addEventListener("click", function(e) { - video.loop = (i != 0); - if (i != 0 && video.currentTime >= video.duration) { - video.currentTime = 0; + if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { + video.loop = (i != 0); + if (i != 0 && video.currentTime >= video.duration) { + video.currentTime = 0; + } + loopLinks[i].style.fontWeight = "bold"; + loopLinks[1-i].style.fontWeight = "inherit"; + e.preventDefault(); } - loopLinks[i].style.fontWeight = "bold"; - loopLinks[1-i].style.fontWeight = "inherit"; - e.preventDefault(); }, false); } for (var i = 0; i < 2; i++) {