From 870183f4b2e755a9e4ae58194d1cd5d03579980b Mon Sep 17 00:00:00 2001 From: Max Cantor Date: Fri, 6 May 2011 11:47:20 -0400 Subject: implementing ilya's suggestion for incrementing the frame --- background_page.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'background_page.html') 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 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 }); }); -- cgit v1.2.3