1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:28:01 +01:00

fix focus problem for Paul :)

This commit is contained in:
Martin Stubenschrott
2008-06-11 22:48:32 +00:00
parent 3e11d296c2
commit 8589c22226
3 changed files with 13 additions and 7 deletions

View File

@@ -270,7 +270,8 @@ liberator.Events = function () //{{{
liberator.statusline.updateTabCount();
liberator.tabs.updateSelectionHistory();
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
if (liberator.options["focuscontent"])
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
}, false);
}
@@ -943,13 +944,12 @@ liberator.Events = function () //{{{
if (liberator.mode == liberator.modes.COMMAND_LINE)
return;
// liberator.log("onFocusChange: " + liberator.buffer.loaded);
var win = window.document.commandDispatcher.focusedWindow;
var elem = window.document.commandDispatcher.focusedElement;
if (elem && elem.readOnly)
return;
// liberator.log("onFocusChange: " + elem);
// dump("=+++++++++=\n" + liberator.util.objectToString(event.target) + "\n")
// dump (elem + ": " + win + "\n");//" - target: " + event.target + " - origtarget: " + event.originalTarget + " - expltarget: " + event.explicitOriginalTarget + "\n");
@@ -1405,8 +1405,14 @@ liberator.Events = function () //{{{
{
liberator.buffer.loaded = 0;
liberator.statusline.updateProgress(0);
setTimeout (function () { liberator.modes.reset(false); },
liberator.mode == liberator.modes.HINTS ? 500 : 0);
// don't reset mode if a frame of the frameset gets reloaded which
// is not the focused frame
if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow)
{
setTimeout (function () { liberator.modes.reset(false); },
liberator.mode == liberator.modes.HINTS ? 500 : 0);
}
}
else if (flags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
{

View File

@@ -559,6 +559,7 @@ const liberator = (function () //{{{
if (window == ww.activeWindow && document.commandDispatcher.focusedElement && clearFocusedElement)
document.commandDispatcher.focusedElement.blur();
liberator.log("focusContent: " + clearFocusedElement);
// TODO: make more generic
try
{

View File

@@ -98,7 +98,7 @@ liberator.modes = (function () //{{{
function handleModeChange(oldMode, newMode)
{
// TODO: fix v.log() to work with verbosity level
// liberator.log("switching from mode " + oldMode + " to mode " + newMode, 7);
liberator.log("switching from mode " + oldMode + " to mode " + newMode, 7);
// dump("switching from mode " + oldMode + " to mode " + newMode + "\n");
switch (oldMode)
@@ -248,7 +248,6 @@ liberator.modes = (function () //{{{
// keeps recording state
reset: function (silent)
{
//if (window.wintype == "msgcompose")
if (liberator.config.isComposeWindow)
this.set(liberator.modes.COMPOSE, liberator.modes.NONE, silent);
else