From a16a8aefe7206d00d7b40bea4b175065c638d091 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 11 Nov 2013 03:11:52 -0800 Subject: [PATCH] clicking below collapse button --- expandvideo.js | 8 ++++++-- 1 file 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); } }