Make the click behavior in the search bar the same as in the urlbar.

This commit is contained in:
blakeross%telocity.com 2002-09-29 23:18:47 +00:00
parent e3dc96b982
commit c8bfaaf595
2 changed files with 14 additions and 11 deletions

View File

@ -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

View File

@ -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"/>