From d9e8da958d55de5c8880b336255cf8987986be93 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 25 Jun 2015 12:16:51 +0100 Subject: Make global marks consistent with other tab creation operations. This makes global marks use the same code for opening new tabs as other operations. Thus, the new tab appears in the same position as it would if it were created, for example, via the vomnibar. To do this properly, we move the three tab-creating functions into an object which can be (and is) exported (TabOperations). Also fixes these three operations such that they all take the same arguments; that is (request, callback). Not all of these callbacks are being used. But we should be consistent. --- background_scripts/marks.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts/marks.coffee') diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee index 6e5f08ba..70ec1c17 100644 --- a/background_scripts/marks.coffee +++ b/background_scripts/marks.coffee @@ -82,7 +82,7 @@ Marks = @gotoPositionInTab extend markInfo, tabId: tab.id else # There is no existing matching tab, we'll have to create one. - chrome.tabs.create { url: @getBaseUrl markInfo.url }, (tab) => + TabOperations.openUrlInNewTab { url: @getBaseUrl markInfo.url }, (tab) => # Note. tabLoadedHandlers is defined in "main.coffee". The handler below will be called when the tab # is loaded, its DOM is ready and it registers with the background page. tabLoadedHandlers[tab.id] = => @gotoPositionInTab extend markInfo, tabId: tab.id -- cgit v1.2.3