From 4d1c51306874d4d92dd75defb4b0c2fbd56e289a Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@donarmstrong.com>
Date: Wed, 24 Sep 2008 08:35:22 -0700
Subject: [PATCH] Allow clicking anywhere outside the extra status box to close
 the extra status box (closes: #499990) Thanks to James Vega for the patch.

---
 cgi/pkgreport.cgi                             |  1 +
 debian/changelog                              |  2 ++
 html/bugs.css                                 | 13 +++++++++++++
 templates/en_US/cgi/pkgreport_javascript.tmpl | 10 +++++++++-
 4 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index 800c4715..2a69dfd1 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -441,6 +441,7 @@ print "<HTML><HEAD>\n" .
     "</HEAD>\n" .
     '<BODY onload="pagemain();">' .
     "\n";
+print qq(<DIV id="status_mask"></DIV>\n);
 print "<H1>" . "$gProject$Archived $gBug report logs: $title" .
       "</H1>\n";
 
diff --git a/debian/changelog b/debian/changelog
index 2982cfeb..f4ddd6bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -220,6 +220,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low
   * Link to packages in bugreport page (closes: #229067)
   * Totally revamp the pkgreport templates (closes: #434504)
   * Add correspondent option to track bug correpondents (closes: #485804)
+  * Allow clicking anywhere outside the extra status box to close the
+    extra status box (closes: #499990) Thanks to James Vega for the patch.
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100
diff --git a/html/bugs.css b/html/bugs.css
index 2a320f4b..b61e5b14 100644
--- a/html/bugs.css
+++ b/html/bugs.css
@@ -252,6 +252,19 @@ li {
   display: inline;
   }
 
+#status_mask {
+    -moz-opacity: 0;
+    opacity: 0;
+    filter: alpha(opacity=0);
+    z-index: 1;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0px;
+    left: 0px;
+    display: none;
+}
+
 .bugs li {
     margin-top: 5px;
 }
diff --git a/templates/en_US/cgi/pkgreport_javascript.tmpl b/templates/en_US/cgi/pkgreport_javascript.tmpl
index f801df96..a786cbfc 100644
--- a/templates/en_US/cgi/pkgreport_javascript.tmpl
+++ b/templates/en_US/cgi/pkgreport_javascript.tmpl
@@ -26,7 +26,7 @@ function toggle_extra_status_visible() \{
 	 else \{
 	    all_divs[i].style.position = "absolute";
       	    all_divs[i].style.display = "none"
-	    all_divs[i].style.zIndex = 1;
+	    all_divs[i].style.zIndex = 2;
 	    all_divs[i].style.border = "#000 1px solid";
 	    var subspans = all_divs[i].getElementsByTagName("span");
 	    for (var j = 0; j < subspans.length; j++) \{
@@ -38,9 +38,13 @@ function toggle_extra_status_visible() \{
 \}
 
 function extra_status_visible(id) \{
+  var m = document.getElementById("status_mask");
   if (visible_extra_status) \{
      var t = document.getElementById("extra_status_"+visible_extra_status);
      t.style.display = "none";
+     if (m) \{
+        m.style.display = "none";
+     \}
      if (visible_extra_status == id) \{
      	visible_extra_status = 0;
         return;
@@ -51,6 +55,10 @@ function extra_status_visible(id) \{
   if (e) \{
      e.style.display = "block";
      visible_extra_status = id;
+     if (m) \{
+        m.onclick = function() \{ extra_status_visible(id); \};
+        m.style.display = "block";
+     \}
   \}
 \}
 
-- 
2.39.5