зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597403 - remove superfluous search tree blur code now that the tree widget handles this correctly, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D54230 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
25c223ac03
Коммит
a33147cebe
|
@ -66,7 +66,6 @@ var gSearchPane = {
|
|||
window.addEventListener("dragstart", this);
|
||||
window.addEventListener("keypress", this);
|
||||
window.addEventListener("select", this);
|
||||
window.addEventListener("blur", this, true);
|
||||
|
||||
Services.obs.addObserver(this, "browser-search-engine-modified");
|
||||
window.addEventListener("unload", () => {
|
||||
|
@ -387,11 +386,6 @@ var gSearchPane = {
|
|||
gSearchPane.onTreeSelect();
|
||||
}
|
||||
break;
|
||||
case "blur":
|
||||
if (aEvent.target.id == "engineList") {
|
||||
gSearchPane.onInputBlur(aEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -406,7 +400,13 @@ var gSearchPane = {
|
|||
break;
|
||||
case "engine-changed":
|
||||
gEngineView._engineStore.reloadIcons();
|
||||
gEngineView.invalidate();
|
||||
// Only bother invalidating if the tree is valid. It might not be
|
||||
// if we're here because we saved an engine keyword change when
|
||||
// the input got blurred as a result of changing categories, which
|
||||
// destroys the tree.
|
||||
if (gEngineView.tree) {
|
||||
gEngineView.invalidate();
|
||||
}
|
||||
break;
|
||||
case "engine-removed":
|
||||
gSearchPane.remove(aEngine);
|
||||
|
@ -443,17 +443,6 @@ var gSearchPane = {
|
|||
}
|
||||
},
|
||||
|
||||
onInputBlur(aEvent) {
|
||||
let tree = document.getElementById("engineList");
|
||||
if (!tree.hasAttribute("editing")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Accept input unless discarded.
|
||||
let accept = aEvent.charCode != KeyEvent.DOM_VK_ESCAPE;
|
||||
tree.stopEditing(accept);
|
||||
},
|
||||
|
||||
onTreeSelect() {
|
||||
document.getElementById(
|
||||
"removeEngineButton"
|
||||
|
|
Загрузка…
Ссылка в новой задаче