зеркало из https://github.com/mozilla/gecko-dev.git
Pressing Esc while urlbar has focus should revert url to that of page and select contents of urlbar (47863, patch by doronr@naboonline.com). r=bz sr=alecf
This commit is contained in:
Родитель
334ce6620e
Коммит
94b6354336
|
@ -1190,5 +1190,26 @@ function ShowAndSelectContentsOfURLBar()
|
|||
else
|
||||
gURLBar.focus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If "ESC" is pressed in the url bar, we replace the urlbar's value with the url of the page
|
||||
// and highlight it, unless it is about:blank, where we reset it to "".
|
||||
function resetURLBar()
|
||||
{
|
||||
var url = _content.location.href;
|
||||
var throbberElement = document.getElementById("navigator-throbber");
|
||||
|
||||
if (!throbberElement.getAttribute("busy")){
|
||||
if (url != "about:blank"){
|
||||
gURLBar.value = url;
|
||||
gURLBar.select();
|
||||
} else { //if about:blank, urlbar becomes ""
|
||||
gURLBar.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleURLBarKeyPress(event)
|
||||
{
|
||||
if (event.keyCode == KeyEvent.DOM_VK_RETURN) { addToUrlbarHistory(); BrowserLoadURL(); }
|
||||
else if (event.keyCode == KeyEvent.DOM_VK_ESCAPE) { resetURLBar(); }
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ Contributor(s): ______________________________________. -->
|
|||
searchSessionType="urlbar" id="urlbar" tooltip="aTooltip" tooltiptext="&locationBar.tooltip;"
|
||||
onclick="if (event.button == 0) URLBarLeftClickHandler(event);"
|
||||
onblur="URLBarBlurHandler(event);"
|
||||
onkeypress="handleURLBarKeyPress(event);" flex="1"/>
|
||||
onkeypress="if (event.keyCode == 13) { addToUrlbarHistory(); BrowserLoadURL(); }" flex="1"/>
|
||||
</hbox>
|
||||
<menubutton class="menubutton-icon" id="ubhist">
|
||||
|
|
|
@ -329,6 +329,7 @@ var homeButtonObserver = {
|
|||
|
||||
onDragExit: function (aEvent, aDragSession)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче