changeset 12:ea3ec9f460db

Removed loading screen.
author Atul Varma <varmaa@toolness.com>
date Mon, 08 Mar 2010 21:58:54 -0800
parents ac252dd4b395
children 1c1e538d7df7
files dashboard.css dashboard.js index.html
diffstat 3 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/dashboard.css	Mon Mar 08 10:24:18 2010 -0800
+++ b/dashboard.css	Mon Mar 08 21:58:54 2010 -0800
@@ -13,10 +13,6 @@
     background: yellow;
 }
 
-#reports {
-    display: none;
-}
-
 #reports .container {
     display: table;
 }
@@ -32,6 +28,7 @@
 
 #reports .container h2 {
     margin-top: 0;
+    width: 20em;
 }
 
 #templates {
@@ -47,7 +44,7 @@
 }
 
 table {
-    width: 30em;
+    width: 100%;
     border-collapse: collapse;
 }
 
--- a/dashboard.js	Mon Mar 08 10:24:18 2010 -0800
+++ b/dashboard.js	Mon Mar 08 21:58:54 2010 -0800
@@ -1,7 +1,5 @@
 $(window).ready(
   function() {
-    var reportsLeft = 0;
-
     function sortByLastChanged(bugs) {
       var lctimes = {};
 
@@ -64,7 +62,11 @@
       query.append(table);
     }
 
-    function finalizeReports() {
+    // Remove duplicate bugs, preferring the first listing of a bug in
+    // the DOM to later ones. This is b/c the reports further down the
+    // page are the less "interesting" ones, and we want to capture
+    // the most "interesting" part of each bug.
+    function removeDuplicateBugs() {
       var visited = {};
       $("#reports .bug-row").each(
         function() {
@@ -74,8 +76,6 @@
           else
             visited[id] = true;
         });
-      $("#loading-screen").hide();
-      $("#reports").fadeIn();
     }
 
     function report(selector, searchTerms) {
@@ -85,12 +85,8 @@
       Bugzilla.search(newTerms,
                       function(response) {
                         showBugs($(selector), response.bugs);
-                        reportsLeft--;
-                        $("#loading-screen .countdown").text(reportsLeft);
-                        if (!reportsLeft)
-                          finalizeReports();
+                        removeDuplicateBugs();
                       });
-      reportsLeft++;
     }
 
     // Taken from MDC @ Core_JavaScript_1.5_Reference/Objects/Date.
@@ -156,6 +152,4 @@
             email2_type: "not_equals",
             email2_assigned_to: 1,
             email2_reporter: 1});
-
-    $("#loading-screen .countdown").text(reportsLeft);
   });
--- a/index.html	Mon Mar 08 10:24:18 2010 -0800
+++ b/index.html	Mon Mar 08 21:58:54 2010 -0800
@@ -6,7 +6,6 @@
   <title>Atul's Bugzilla Dashboard</title>
 </head>
 <body>
-<div id="loading-screen"><h1 class="countdown"></h1></div>
 <div id="reports">
   <h1>Atul's Bugzilla Dashboard</h1>
   <div class="container">