Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Open a bookmark item in a foreground tab
Browse files Browse the repository at this point in the history
If SWITCH_TO_NEW_TABS is truthy (or if Shift key is pressed: this is the
current behavior)

Auditors: @bsclifton

Test Plan:
  - Simulate middle clicking a bookmark item
  - Check that a new foreground tab is opened with the same URL as that of the
  bookmark (or just check that if such an event is fired if a URL check is not
  feasible)

Fix #3207.
  • Loading branch information
GreenRecycleBin authored and bsclifton committed Nov 26, 2016
1 parent 1726e9c commit 87d9bf2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/actions/bookmarkActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
const siteUtil = require('../state/siteUtil')
const windowActions = require('./windowActions')
const eventUtil = require('../lib/eventUtil')
const {SWITCH_TO_NEW_TABS} = require('../constants/settings')
const getSetting = require('../settings').getSetting

const bookmarkActions = {
openBookmarksInFolder: function (allBookmarkItems, folderDetail) {
Expand All @@ -17,7 +19,7 @@ const bookmarkActions = {
// Only load the first 25 tabs as loaded
bookmarks
.forEach((bookmark, i) =>
windowActions.newFrame(Object.assign(siteUtil.toFrameOpts(bookmark), {unloaded: i > 25}), false))
windowActions.newFrame(Object.assign(siteUtil.toFrameOpts(bookmark), {unloaded: i > 25}), getSetting(SWITCH_TO_NEW_TABS)))
},

/**
Expand All @@ -31,7 +33,7 @@ const bookmarkActions = {
windowActions.newFrame({
location: bookmarkItem.get('location'),
partitionNumber: bookmarkItem && bookmarkItem.get && bookmarkItem.get('partitionNumber') || undefined
}, !!e.shiftKey)
}, !!e.shiftKey || getSetting(SWITCH_TO_NEW_TABS))
} else {
windowActions.loadUrl(activeFrame, bookmarkItem.get('location'))
}
Expand Down

0 comments on commit 87d9bf2

Please sign in to comment.