mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-21 18:11: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:
+6
-9
@@ -311,8 +311,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
|
||||
@@ -328,7 +329,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();
|
||||
@@ -391,6 +392,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";
|
||||
@@ -403,12 +406,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()
|
||||
|
||||
Reference in New Issue
Block a user