1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-21 15:51:26 +02:00

don't attempt to add the frame indicator if v.buffer.shiftFrameFocus is called

on a non-HTML document
This commit is contained in:
Doug Kearns
2007-11-09 11:56:14 +00:00
parent 9ca8bb2cc7
commit 61c55f6f1d
+6 -9
View File
@@ -267,8 +267,9 @@ vimperator.Buffer = function() //{{{
// TODO: allow callback for filtering out unwanted frames? User defined?
this.shiftFrameFocus = function(count, forward)
{
try
{
if (!window.content.document instanceof HTMLDocument)
return;
var frames = [];
// find all frames - depth-first search
@@ -284,7 +285,7 @@ vimperator.Buffer = function() //{{{
return;
// remove all unfocusable frames
// TODO: find a better way to do this
// TODO: find a better way to do this - walking the tree is too slow
var start = document.commandDispatcher.focusedWindow;
frames = frames.filter(function(frame) {
frame.focus();
@@ -347,6 +348,8 @@ vimperator.Buffer = function() //{{{
frames[next].frameElement.scrollIntoView(false);
// add the frame indicator
// TODO: make this an XBL element rather than messing with the content
// document
var doc = frames[next].document;
var indicator = doc.createElement("div");
indicator.id = "vimperator-frame-indicator";
@@ -359,12 +362,6 @@ vimperator.Buffer = function() //{{{
// remove the frame indicator
setTimeout(function() { doc.body.removeChild(indicator); }, 500);
}
catch (e)
{
// FIXME: fail silently here for now
//vimperator.log(e);
}
}
// updates the buffer preview in place only if list is visible
this.updateBufferList = function()