aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Cantor2011-05-06 11:47:20 -0400
committerMax Cantor2011-05-06 11:47:20 -0400
commit870183f4b2e755a9e4ae58194d1cd5d03579980b (patch)
tree6d3b50850bb0e0a3401ec0a7f2d0e2994c7a9474
parentc5ad2a1642d14c23483fc3ebb6b5d1059116e9ea (diff)
downloadvimium-870183f4b2e755a9e4ae58194d1cd5d03579980b.tar.bz2
implementing ilya's suggestion for incrementing the frame
-rw-r--r--background_page.html7
1 files changed, 1 insertions, 6 deletions
diff --git a/background_page.html b/background_page.html
index eca7271c..5849bde3 100644
--- a/background_page.html
+++ b/background_page.html
@@ -690,15 +690,10 @@
chrome.tabs.getSelected(null, function(tab) {
var frames = framesForTab[tab.id].frames;
var curr_index = getCurrFrameIndex(frames);
- var new_index = curr_index;
// TODO: Skip the "top" frame (which doesn't actually have a <frame> tag),
// since it exists only to contain the other frames.
- for (var i=0; i < count; i++) {
- new_index++;
- if (new_index >= frames.length)
- new_index = 0;
- }
+ var new_index = (curr_index + count) % frames.length;
chrome.tabs.sendRequest(tab.id, { name: "focusFrame", frameId: frames[new_index].id, highlight: true });
});