Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fae8d4e authored by Scott Main's avatar Scott Main Committed by Android Git Automerger
Browse files

am 71b28a60: Merge "docs: add check in hash-change callback to be sure we\'re...

am 71b28a60: Merge "docs: add check in hash-change callback to be sure we\'re only dealing with hash-tags that are search queries. bug: 6843654" into jb-dev

* commit '71b28a60':
  docs: add check in hash-change callback to be sure we're only dealing with hash-tags that are search queries. bug: 6843654
parents 57267e56 71b28a60
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -282,7 +282,6 @@ function hideResults() {
  $("#searchResults").slideUp();
  $(".search .close").addClass("hide");
  location.hash = '';
  drawOptions.setInput(document.getElementById("searchResults"));
  
  $("#search_autocomplete").val("").blur();
  
@@ -309,7 +308,6 @@ function hideResults() {
      var searchControl;

      function loadSearchResults() {
        
        document.getElementById("search_autocomplete").style.color = "#000";

        // create search control
@@ -397,11 +395,17 @@ function hideResults() {

      // when an event on the browser history occurs (back, forward, load) requery hash and do search
      $(window).hashchange( function(){
        var query = decodeURI(getQuery(location.hash));
        if (query == "undefined") {
        // Exit if the hash isn't a search query or there's an error in the query
        if ((location.hash.indexOf("q=") == -1) || (query == "undefined")) {
          // If the results pane is open, close it.
          if (!$("#searchResults").is(":hidden")) {
            hideResults();
          }
          return;
        }

        // Otherwise, we have a search to do
        var query = decodeURI(getQuery(location.hash));
        searchControl.execute(query);
        $('#searchResults').slideDown('slow');
        $("#search_autocomplete").focus();