Bug 594918 - dismiss vkb as a user starts to pan the awesomelist [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 14 Oct 2010 15:21:17 +0200
changeset 66832 0e168f65c3578a2b1f1d5fa29e0b47ef25018327
parent 66831 755bb256ca466e1b383dcdd0b9cf2bd903fd7c83
child 66833 cb131a9ce6f1b01846d3a0385e074b20a2709da3
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
bugs594918
Bug 594918 - dismiss vkb as a user starts to pan the awesomelist [r=mfinkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -431,16 +431,17 @@ var BrowserUI = {
     awesomePopup.addEventListener("popupshown", this, false);
     awesomePopup.addEventListener("popuphidden", this, false);
 
     document.getElementById("toolbar-main").ignoreDrag = true;
 
     let tabs = document.getElementById("tabs");
     tabs.addEventListener("TabSelect", this, true);
     tabs.addEventListener("TabOpen", this, true);
+    window.addEventListener("PanBegin", this, true);
     window.addEventListener("PanFinished", this, true);
 
     // listen content messages
     messageManager.addMessageListener("DOMLinkAdded", this);
     messageManager.addMessageListener("DOMTitleChanged", this);
     messageManager.addMessageListener("DOMWillOpenModalDialog", this);
     messageManager.addMessageListener("DOMWindowClose", this);
     // XXX bug 604192
@@ -812,16 +813,22 @@ var BrowserUI = {
 
         // Workaround to hide the tabstrip if it is partially visible
         // See bug 524469
         if (tabsVisibility > 0.0 && tabsVisibility < 1.0)
           Browser.hideSidebars();
 
         break;
       }
+      case "PanBegin":
+        if (this.activePanel && !this._edit.readOnly) {
+          this._edit.readOnly = true;
+          this._edit.blur();
+        }
+        break;
       case "PanFinished":
         let [tabsVisibility,,,] = Browser.computeSidebarVisibility();
         if (tabsVisibility == 0.0)
           document.getElementById("tabs").removeClosedTab();
         break;
       // Window events
       case "keydown":
         // If there is no VKB the user won't be able to enter any letter,
@@ -893,17 +900,17 @@ var BrowserUI = {
       case "DOMWindowClose":
         return this._domWindowClose(browser);
         break;
       case "DOMLinkAdded":
         if (Browser.selectedBrowser == browser)
           this._updateIcon(Browser.selectedBrowser.mIconURL);
         break;
       case "pagehide":
-        // XXX bug 60419, when a content web page is close the content sometimes
+        // XXX bug 604192, when a content web page is close the content sometimes
         // dismiss the VKB, we're trying to avoid that by adding it back again.
         let utils = Util.getWindowUtils(window);
         if (this.activePanel && !this._edit.readOnly && browser.currentURI.spec != "about:blank" && utils.IMEStatus == utils.IME_STATUS_DISABLED) {
           this._edit.readOnly = !this._edit.readOnly;
           this._edit.readOnly = !this._edit.readOnly;
         }
         break;
       case "Browser:SaveAs:Return":