summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccd0 <admin@containerchan.org>2013-11-15 22:33:48 -0800
committerccd0 <admin@containerchan.org>2013-11-15 22:33:48 -0800
commit827bc5f0a1b2ce1e7bd1ac844190338914ed38e4 (patch)
treea3559d0c9505485afda137971ce5c3bbd6dfceca
parent6b0b1fe144d1bdc876c29edb827f172e82794176 (diff)
remove other collapse methods
-rw-r--r--expandvideo.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/expandvideo.js b/expandvideo.js
index ef21b62f..db7f3ecd 100644
--- a/expandvideo.js
+++ b/expandvideo.js
@@ -31,12 +31,6 @@ function setupVideo(thumb, url) {
video.src = url;
video.loop = loop;
video.innerText = "Your browser does not support HTML5 video.";
- video.addEventListener("click", function(e) {
- if (e.shiftKey) {
- unexpand();
- e.preventDefault();
- }
- }, false);
videoHide = document.createElement("img");
videoHide.src = configRoot + "cc/collapse.gif";
@@ -44,6 +38,7 @@ function setupVideo(thumb, url) {
videoHide.title = "Collapse video";
videoHide.style.marginLeft = "-15px";
videoHide.style.cssFloat = "left";
+ videoHide.addEventListener("click", unexpand, false);
videoContainer = document.createElement("div");
videoContainer.style.paddingLeft = "15px";
@@ -51,11 +46,6 @@ function setupVideo(thumb, url) {
videoContainer.appendChild(video);
thumb.parentNode.insertBefore(videoContainer, thumb.nextSibling);
- // Clicking anywhere in the strip beneath the collapse button collapses the video
- videoContainer.addEventListener("click", function(e) {
- if (e.target != video) unexpand();
- } , false);
-
// Dragging to the left collapses the video
video.addEventListener("mousedown", function(e) {
if (e.button == 0) mouseDown = true;
@@ -105,7 +95,7 @@ function setupVideo(thumb, url) {
expanded = false;
hovering = true;
- var docRight = document.body.parentNode.getBoundingClientRect().right;
+ var docRight = document.documentElement.getBoundingClientRect().right;
var thumbRight = thumb.querySelector("img, video").getBoundingClientRect().right;
var maxWidth = docRight - thumbRight - 20;
if (maxWidth < 250) maxWidth = 250;
@@ -113,7 +103,7 @@ function setupVideo(thumb, url) {
video.style.position = "fixed";
video.style.right = "0px";
video.style.top = "0px";
- var docRight = document.body.parentNode.getBoundingClientRect().right;
+ var docRight = document.documentElement.getBoundingClientRect().right;
var thumbRight = thumb.querySelector("img, video").getBoundingClientRect().right;
video.style.maxWidth = maxWidth + "px";
video.style.maxHeight = "100%";