Bug 1316863 - stop manually closing the search popup to solve issues that seem to not exist anymore, r=florian,nhnt11

MozReview-Commit-ID: 3lcONwqYEFc

--HG--
extra : rebase_source : 7ebf8e3afd17fbd130cc34c642baea409239662c
This commit is contained in:
Gijs Kruitbosch 2016-11-16 13:33:37 +00:00
Родитель 65237b3417
Коммит 5011f3b7eb
1 изменённых файлов: 7 добавлений и 12 удалений

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

@ -974,10 +974,6 @@
// Handle search bar popup clicks
var search = controller.getValueAt(this.selectedIndex);
// close the autocomplete popup and revert the entered search term
this.closePopup();
controller.handleEscape();
// open the search results according to the clicking subtlety
var where = whereToOpenLink(aEvent, false, true);
let params = {};
@ -990,6 +986,13 @@
(aEvent.button == 1 || modifier))
params.inBackground = true;
// leave the popup open for background tab loads
if (!(where == "tab" && params.inBackground)) {
// close the autocomplete popup and revert the entered search term
this.closePopup();
controller.handleEscape();
}
searchBar.doSearch(search, where, null, params);
if (where == "tab" && params.inBackground)
searchBar.focus();
@ -2227,14 +2230,6 @@
if (!engine)
return;
// For some reason, if the context menu had been opened prior to the
// click, the suggestions popup won't be closed after loading the search
// in the current tab - so we hide it manually. Some focusing magic
// that happens when a search is loaded ensures that the popup is opened
// again if it needs to be, so we don't need to worry about which cases
// require manual hiding.
this.popup.hidePopup();
// Select the clicked button so that consumers can easily tell which
// button was acted on.
this.selectedButton = button;