summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccd0 <admin@containerchan.org>2013-11-11 03:11:52 -0800
committerccd0 <admin@containerchan.org>2013-11-11 03:11:52 -0800
commita16a8aefe7206d00d7b40bea4b175065c638d091 (patch)
treeaa048bf85b454996285ab49e47cadf0d5264b72f
parent0b6e71dd2547ccd8a299242dd56d52f11a888b36 (diff)
clicking below collapse button
-rw-r--r--expandvideo.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/expandvideo.js b/expandvideo.js
index b79b52ce..41988f44 100644
--- a/expandvideo.js
+++ b/expandvideo.js
@@ -40,16 +40,20 @@ function setupVideo(thumb, url) {
videoHide = document.createElement("img");
videoHide.src = configRoot + "cc/collapse.gif";
videoHide.alt = "[ - ]";
- videoHide.title = "Collapse to thumbnail";
+ videoHide.title = "Collapse video";
videoHide.style.verticalAlign = "top";
videoHide.style.marginRight = "2px";
- videoHide.addEventListener("click", unexpand, false);
videoContainer = document.createElement("div");
videoContainer.style.whiteSpace = "nowrap";
videoContainer.appendChild(videoHide);
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);
}
}