ginebra2/chrome/bedrockchrome/suggests.snippet/suggests.js
changeset 6 1c3b8676e58c
parent 5 0f2326c2a325
child 15 73c48011b8c7
--- a/ginebra2/chrome/bedrockchrome/suggests.snippet/suggests.js	Wed Jun 23 17:59:43 2010 +0300
+++ b/ginebra2/chrome/bedrockchrome/suggests.snippet/suggests.js	Tue Jul 06 14:03:49 2010 +0300
@@ -84,7 +84,7 @@
     {
         var recenturl;
         var recenttitle = window.localeDelegate.translateText(
-            "txt_browser_url_bar_drop_down_search_for");
+            "txt_browser_chrome_suggests_search_for");
         var snippetId = document.getElementById('SuggestsId');
         var suggests = window.pageController.fetchSuggestions(input);
         var suggestUL = document.createElement('ul');
@@ -210,7 +210,7 @@
     */
     this.handleExternalMouseEvent = function(type, name, description)
     {
-        if (name == "QGraphicsSceneMousePressEvent") {
+        if (name == "MouseClick") {
             _hideSuggests();
         }
     }
@@ -236,6 +236,19 @@
         }
     }
 
+    //! Called when URL search bar looses focus. The external mouse event
+    //! handler deals with most cases where the suggestion list should be
+    //! dismissed but we don't get those events when the list isn't visible
+    //! so this handler is needed to cancel the timer in those cases.
+    this.urlSearchLostFocus = function()
+    {
+        // if visible user may be scrolling suggestion page so ignore focus change
+        if (!snippets.SuggestsChromeId.visible) {
+            // prevent suggestion list from being displayed until URL edited again
+            clearTimeout(inputTimeoutId);
+        }
+    }
+
     //! Sets the user input URL suggest delay.
     /*!
       \param to the new delay time.