1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 22:24:13 +01:00

quick fix for #9 ("gi" Goes To Address Bar, not to Webpage)

This commit is contained in:
Doug Kearns
2008-11-05 01:58:13 +00:00
parent 6c6b70a2c5
commit a39226ff23

View File

@@ -1053,8 +1053,11 @@ function Events() //{{{
if (liberator.mode == modes.COMMAND_LINE)
return;
function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument
var win = window.document.commandDispatcher.focusedWindow;
var elem = window.document.commandDispatcher.focusedElement;
if (elem && elem.readOnly)
return;
@@ -1069,7 +1072,8 @@ function Events() //{{{
{
this.wantsModeReset = false;
liberator.mode = modes.INSERT;
buffer.lastInputField = elem;
if (hasHTMLDocument(win))
buffer.lastInputField = elem;
return;
}
@@ -1082,15 +1086,15 @@ function Events() //{{{
modes.set(modes.VISUAL, modes.TEXTAREA);
else
modes.main = modes.TEXTAREA;
buffer.lastInputField = elem;
if (hasHTMLDocument(win))
buffer.lastInputField = elem;
return;
}
if (config.name == "Muttator")
{
// we switch to -- MESSAGE -- mode for muttator, when the main HTML widget gets focus
if ((win && win.document && win.document instanceof HTMLDocument)
|| elem instanceof HTMLAnchorElement)
if (hasHTMLDocument(win) || elem instanceof HTMLAnchorElement)
{
if (config.isComposeWindow)
{