зеркало из https://github.com/mozilla/pjs.git
Bug 361735 - middleclick on a search suggestion should open the result in a new tab p=Simon Bunzli <zeniko@gmail.com> r=gavin
This commit is contained in:
Родитель
3aa22ac041
Коммит
5160347c0d
|
@ -518,6 +518,8 @@
|
||||||
}
|
}
|
||||||
// completely ignore right-clicks
|
// completely ignore right-clicks
|
||||||
else if (aEvent.button != 2) {
|
else if (aEvent.button != 2) {
|
||||||
|
if (gURLBar && this.mInput == gURLBar) {
|
||||||
|
// handle address bar click
|
||||||
var url = controller.getValueAt(this.tree.view.selection.currentIndex);
|
var url = controller.getValueAt(this.tree.view.selection.currentIndex);
|
||||||
|
|
||||||
// close the autocomplete popup and revert the entered address
|
// close the autocomplete popup and revert the entered address
|
||||||
|
@ -526,6 +528,23 @@
|
||||||
// respect the usual clicking subtleties
|
// respect the usual clicking subtleties
|
||||||
openUILink(url, aEvent);
|
openUILink(url, aEvent);
|
||||||
}
|
}
|
||||||
|
else if (this.mInput._getParentSearchbar) {
|
||||||
|
// handle search bar click
|
||||||
|
var search = controller.getValueAt(this.tree.view.selection.currentIndex);
|
||||||
|
var textbox = this.mInput;
|
||||||
|
|
||||||
|
// close the autocomplete popup and copy the selected value to the search box
|
||||||
|
this.closePopup();
|
||||||
|
textbox.value = search;
|
||||||
|
// open the search results according to the clicking subtlety
|
||||||
|
var where = whereToOpenLink(aEvent, false, true);
|
||||||
|
textbox._getParentSearchbar().doSearch(search, where);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// everybody else (i.e. browser content) gets unmodified behavior
|
||||||
|
controller.handleEnter();
|
||||||
|
}
|
||||||
|
}
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
</implementation>
|
</implementation>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче