mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Make the click behavior in the search bar the same as in the urlbar.
This commit is contained in:
parent
e3dc96b982
commit
c8bfaaf595
@ -1036,29 +1036,29 @@ function stylesheetSwitchAll(frameset, title) {
|
||||
}
|
||||
|
||||
|
||||
function URLBarFocusHandler(aEvent)
|
||||
function URLBarFocusHandler(aEvent, aElt)
|
||||
{
|
||||
if (gIgnoreFocus)
|
||||
gIgnoreFocus = false;
|
||||
else if (gClickSelectsAll)
|
||||
gURLBar.select();
|
||||
aElt.select();
|
||||
}
|
||||
|
||||
function URLBarMouseDownHandler(aEvent)
|
||||
function URLBarMouseDownHandler(aEvent, aElt)
|
||||
{
|
||||
if (gURLBar.hasAttribute("focused")) {
|
||||
if (aElt.hasAttribute("focused")) {
|
||||
gIgnoreClick = true;
|
||||
} else {
|
||||
gIgnoreFocus = true;
|
||||
gIgnoreClick = false;
|
||||
gURLBar.setSelectionRange(0, 0);
|
||||
aElt.setSelectionRange(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function URLBarClickHandler(aEvent)
|
||||
function URLBarClickHandler(aEvent, aElt)
|
||||
{
|
||||
if (!gIgnoreClick && gClickSelectsAll && gURLBar.selectionStart == gURLBar.selectionEnd)
|
||||
gURLBar.select();
|
||||
if (!gIgnoreClick && gClickSelectsAll && aElt.selectionStart == aElt.selectionEnd)
|
||||
aElt.select();
|
||||
}
|
||||
|
||||
// This function gets the "windows hooks" service and has it check its setting
|
||||
|
@ -751,9 +751,9 @@ Contributor(s):
|
||||
oninput="window.XULBrowserWindow.userTyped.value=true;"
|
||||
ontextentered="return handleURLBarCommand(param);"
|
||||
ontextreverted="return handleURLBarRevert();"
|
||||
onfocus="URLBarFocusHandler(event);"
|
||||
onmousedown="URLBarMouseDownHandler(event);"
|
||||
onclick="URLBarClickHandler(event);">
|
||||
onfocus="URLBarFocusHandler(event, this);"
|
||||
onmousedown="URLBarMouseDownHandler(event, this);"
|
||||
onclick="URLBarClickHandler(event, this);">
|
||||
<deck id="page-proxy-deck">
|
||||
<image id="page-proxy-button"
|
||||
ondraggesture="PageProxyDragGesture(event);"
|
||||
@ -776,6 +776,9 @@ Contributor(s):
|
||||
autocompletepopup="PopupAutoComplete"
|
||||
autocompletesearch="form-history"
|
||||
tabscrolling="true"
|
||||
onfocus="URLBarFocusHandler(event, this);"
|
||||
onmousedown="URLBarMouseDownHandler(event, this);"
|
||||
onclick="URLBarClickHandler(event, this);"
|
||||
ontextentered="return handleSearchBarCommand(param);"
|
||||
persist="searchmode,autocompletesearchparam">
|
||||
<image id="search-proxy-button" popup="SearchBarPopup"/>
|
||||
|
Loading…
Reference in New Issue
Block a user