Bug 925467: Part 2: Blur the about:config search box to close the osk when tapping on content. r=jmathies

This commit is contained in:
Marina Samuel 2013-10-21 13:18:39 -04:00
Родитель 82c43a722e
Коммит 69257c7198
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,11 @@ let Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/Services.jsm");
var ViewConfig = {
get _main() {
delete this._main;
return this._main = document.getElementById("main-container");
},
get _container() {
delete this._container;
return this._container = document.getElementById("prefs-container");
@ -18,6 +23,7 @@ var ViewConfig = {
},
init: function init() {
this._main.addEventListener("click", this, false);
window.addEventListener("resize", this, false);
window.addEventListener("prefchange", this, false);
window.addEventListener("prefnew", this, false);
@ -29,6 +35,7 @@ var ViewConfig = {
},
uninit: function uninit() {
this._main.removeEventListener("click", this, false);
window.removeEventListener("resize", this, false);
window.removeEventListener("prefchange", this, false);
window.removeEventListener("prefnew", this, false);
@ -168,6 +175,10 @@ var ViewConfig = {
case "prefnew":
this._handlePrefChange(aEvent.detail, aEvent.type == "prefnew");
break;
case "click":
this._onClick();
break;
}
},
@ -179,6 +190,12 @@ var ViewConfig = {
mainBox.setAttribute("height", height);
},
_onClick: function () {
// Blur the search box when tapping anywhere else in the content
// in order to close the soft keyboard.
document.getElementById("textbox").blur();
},
_handlePrefChange: function _handlePrefChange(aIndex, aNew) {
let isEditing = !this._editor.hidden;
let shouldUpdateEditor = false;