mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-20 23:15:46 +01:00
quick fix for #9 ("gi" Goes To Address Bar, not to Webpage)
This commit is contained in:
@@ -1053,8 +1053,11 @@ function Events() //{{{
|
|||||||
if (liberator.mode == modes.COMMAND_LINE)
|
if (liberator.mode == modes.COMMAND_LINE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument
|
||||||
|
|
||||||
var win = window.document.commandDispatcher.focusedWindow;
|
var win = window.document.commandDispatcher.focusedWindow;
|
||||||
var elem = window.document.commandDispatcher.focusedElement;
|
var elem = window.document.commandDispatcher.focusedElement;
|
||||||
|
|
||||||
if (elem && elem.readOnly)
|
if (elem && elem.readOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1069,7 +1072,8 @@ function Events() //{{{
|
|||||||
{
|
{
|
||||||
this.wantsModeReset = false;
|
this.wantsModeReset = false;
|
||||||
liberator.mode = modes.INSERT;
|
liberator.mode = modes.INSERT;
|
||||||
buffer.lastInputField = elem;
|
if (hasHTMLDocument(win))
|
||||||
|
buffer.lastInputField = elem;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1082,15 +1086,15 @@ function Events() //{{{
|
|||||||
modes.set(modes.VISUAL, modes.TEXTAREA);
|
modes.set(modes.VISUAL, modes.TEXTAREA);
|
||||||
else
|
else
|
||||||
modes.main = modes.TEXTAREA;
|
modes.main = modes.TEXTAREA;
|
||||||
buffer.lastInputField = elem;
|
if (hasHTMLDocument(win))
|
||||||
|
buffer.lastInputField = elem;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.name == "Muttator")
|
if (config.name == "Muttator")
|
||||||
{
|
{
|
||||||
// we switch to -- MESSAGE -- mode for muttator, when the main HTML widget gets focus
|
// we switch to -- MESSAGE -- mode for muttator, when the main HTML widget gets focus
|
||||||
if ((win && win.document && win.document instanceof HTMLDocument)
|
if (hasHTMLDocument(win) || elem instanceof HTMLAnchorElement)
|
||||||
|| elem instanceof HTMLAnchorElement)
|
|
||||||
{
|
{
|
||||||
if (config.isComposeWindow)
|
if (config.isComposeWindow)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user