summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccd0 <admin@containerchan.org>2013-11-10 21:34:03 -0800
committerccd0 <admin@containerchan.org>2013-11-10 21:34:03 -0800
commit5fbd7a6a959619f811a564f24efb7fae8c0d76f3 (patch)
tree322172df0a164e6d6275b835de25574365612c63
parent9c335764c4ba4aa056cb708390c74ad8b195f193 (diff)
treat controls as links when clicked with modifier keys
-rw-r--r--playersettings.js14
1 files 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++) {