1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 10:07:59 +01:00

fixed textarea/location bar keys properly (location bar still not working, when completion popup is open)

This commit is contained in:
Martin Stubenschrott
2007-09-19 00:32:08 +00:00
parent 578e51d8e3
commit 19d1bb9fef

View File

@@ -25,19 +25,16 @@ function Editor() //{{{
function editor()
{
var editor = window.document.commandDispatcher.focusedElement;
if (editor && editor.mInputField)
editor = editor.mInputField;
return editor;
return window.document.commandDispatcher.focusedElement;
}
function getController()
{
var editor = editor();
if (!editor || !editor.controllers)
var ed = editor();
if (!ed || !ed.controllers)
return null;
return editor.controllers.getControllerAt(0);
return ed.controllers.getControllerForCommand("cmd_beginLine");
}
this.line = function()
@@ -99,11 +96,7 @@ function Editor() //{{{
this.executeCommand = function(cmd, count)
{
var controller = getController();
var el = window.document.commandDispatcher.focusedElement;
if (!controller || !el)
return false;
if (!controller.supportsCommand(cmd) || !controller.isCommandEnabled(cmd))
if (!controller || !controller.supportsCommand(cmd) || !controller.isCommandEnabled(cmd))
{
vimperator.beep();
return false;