Bug 344231: Clicking an autocomplete entry in the search bar doesn't start the search. r=gavin, sr=beng

This commit is contained in:
pamg.bugs%gmail.com 2006-07-20 00:05:42 +00:00
Родитель 0c6df595e9
Коммит ec04d05f85
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -475,11 +475,12 @@
}
// Always open in a new tab on a middle-click; otherwise examine the
// preference and the alt key.
var newTab = (aEvent.button == 1);
// preference and the alt key. If the user chose an autocomplete
// entry with the mouse, aEvent will be null, so treat it as no alt key.
var newTab = (aEvent && aEvent.button == 1);
if (!newTab) {
var newTabPref = textBox._prefBranch.getBoolPref("browser.search.openintab");
newTab = (aEvent.altKey ^ newTabPref);
newTab = ((aEvent && aEvent.altKey) ^ newTabPref);
}
this.doSearch(textValue, newTab);
]]></body>
@ -656,6 +657,7 @@
<body><![CDATA[
var evt = aEvent || this.mEnterEvent;
this._getParentSearchbar().handleSearchCommand(evt);
this.mEnterEvent = null;
]]></body>
</method>
@ -739,7 +741,6 @@
var searchService = Components.classes[contractID]
.getService(nsIACSearch);
searchService.stopSearch();
this.mEnterEvent = null;
this.onTextEntered(event);
]]></handler>