]> git.lizzy.rs Git - rust.git/commitdiff
Speedup search loading when search url is received
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 23 Nov 2017 20:19:48 +0000 (21:19 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 23 Nov 2017 20:19:48 +0000 (21:19 +0100)
src/librustdoc/html/static/main.js

index 34f649aa2d3051235a97a74ed88cb8ddc34de0f4..b131d55ff392084d309495583a72196797e3e533 100644 (file)
             map(function(s) {
                 var pair = s.split("=");
                 params[decodeURIComponent(pair[0])] =
-                    typeof pair[1] === "undefined" ?
-                            null : decodeURIComponent(pair[1]);
+                    typeof pair[1] === "undefined" ? null : decodeURIComponent(pair[1]);
             });
         return params;
     }
             }
         };
     }
+
+    var params = getQueryStringParams();
+    if (params && params.search) {
+        addClass(document.getElementById("main"), "hidden");
+        var search = document.getElementById("search");
+        removeClass(search, "hidden");
+        search.innerHTML = '<h3 style="text-align: center;">Loading search results...</h3>';
+    }
 }());
 
 // Sets the focus on the search bar at the top of the page