Bug 594426 - Awesome popup should internally close when asked for [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 09 Sep 2010 11:08:43 +0200
changeset 66545 730b32c3e11de85f1ca2116c889b47cdd5a72c6c
parent 66544 3aec611495e8409bcce633014472a709a71d0bc8
child 66546 16d709024bc7dd37018d99548d31fd8fef589571
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs594426
Bug 594426 - Awesome popup should internally close when asked for [r=mfinkle]
mobile/chrome/content/bindings.xml
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/bindings.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -40,17 +40,17 @@
       <handler event="text" phase="bubbling">
         <![CDATA[
           if (this.mController.input == this)
             this.mController.handleText();
         ]]>
       </handler>
       <handler event="blur" phase="capturing">
         <![CDATA[
-          // suppress disconnect of autocomplete controller
+          // Bug 583341 - suppress disconnect of autocomplete controller
           this._dontBlur = true;
         ]]>
       </handler>
     </handlers>
   </binding>
 
   <binding id="popup_autocomplete_result">
     <content orient="vertical">
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -561,29 +561,33 @@ var BrowserUI = {
   closeAutoComplete: function closeAutoComplete(aResetInput) {
     if (!this.isAutoCompleteOpen())
       return;
 
     if (aResetInput)
       this._edit.popup.close();
     else
       this._edit.popup.closePopup();
+
+    // Because the controller is not detached during a blur event for Meego
+    // compatibility with the VKB, we need to detach it manually
+    this._edit.detachController();
+    this.activePanel = null;
   },
 
   isAutoCompleteOpen: function isAutoCompleteOpen() {
     return this._edit.popup.popupOpen;
   },
 
   doOpenSearch: function doOpenSearch(aName) {
     // save the current value of the urlbar
     let searchValue = this._edit.value;
 
     // Give the new page lots of room
     Browser.hideSidebars();
-    this.activePanel = null;
     this.closeAutoComplete(false);
 
     // Make sure we're online before attempting to load
     Util.forceOnline();
 
     let engine = Services.search.getEngineByName(aName);
     let submission = engine.getSubmission(searchValue, null);
     Browser.loadURI(submission.uri.spec, { postData: submission.postData });
@@ -922,17 +926,16 @@ var BrowserUI = {
         browser.reloadWithFlags(reloadFlags);
         break;
       }
       case "cmd_stop":
         browser.stop();
         break;
       case "cmd_go":
         this.goToURI();
-        this.activePanel = null;
         break;
       case "cmd_openLocation":
         this.showToolbar(true);
         break;
       case "cmd_star":
       {
         let bookmarkURI = browser.currentURI;
         let autoClose = false;
@@ -1371,20 +1374,18 @@ var AwesomePanel = function(aElementId, 
     this.panel.hidden = true;
     command.removeAttribute("checked", "true");
     BrowserUI.popDialog();
   },
 
   this.openLink = function aw_openLink(aEvent) {
     let item = aEvent.originalTarget;
     let uri = item.getAttribute("url") || item.getAttribute("uri");
-    if (uri != "") {
-      BrowserUI.activePanel = null;
+    if (uri != "")
       BrowserUI.goToURI(uri);
-    }
   }
 };
 
 var BookmarkPopup = {
   get box() {
     delete this.box;
     this.box = document.getElementById("bookmark-popup");